/**   
* @Title: FengKongShenHeServiceImpl.java 
* @Package com.zjdiepu.www.biz.zpp 
* @author zhangpp
* @date 2017年5月26日 上午10:36:55 
* @version V1.0   
*/
package com.zjdiepu.www.biz.zpp;
import java.io.FileReader;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.zjdiepu.www.base.core.AbstractSysUser;
import com.zjdiepu.www.base.core.BaseException;
import com.zjdiepu.www.base.enums.status.BusiStatus;
import com.zjdiepu.www.base.enums.status.DpStatus;
import com.zjdiepu.www.base.enums.status.MessageStatus;
import com.zjdiepu.www.base.enums.status.ThirdBusiStatus;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.base.enums.type.ModeIDType;
import com.zjdiepu.www.base.enums.type.NewsType;
import com.zjdiepu.www.base.enums.type.ResultFlagType;
import com.zjdiepu.www.base.enums.type.SysParamsType;
import com.zjdiepu.www.base.enums.type.ThirdModeIDType;
import com.zjdiepu.www.biz.helper.ServiceHelper;
import com.zjdiepu.www.common.consts.ThreadFactory;
import com.zjdiepu.www.common.util.DateUtil;
import com.zjdiepu.www.common.util.UUIDFactory;
import com.zjdiepu.www.common.util.ZhppDateUtil;
import com.zjdiepu.www.commpent.RedisObjectClient;
import com.zjdiepu.www.dao.base.DpBaseDealerInfoMapper;
import com.zjdiepu.www.dao.cw.CwRemitAdjustBMapper;
import com.zjdiepu.www.dao.cw.CwRemitAdjustbSubMapper;
import com.zjdiepu.www.dao.dh.DhAdvanceMapper;
import com.zjdiepu.www.dao.dh.DhArchiveMapper;
import com.zjdiepu.www.dao.dh.DhDepositMoneyMapper;
import com.zjdiepu.www.dao.dh.DhInsteadPaymentMapper;
import com.zjdiepu.www.dao.dh.DhOverdueListMapper;
import com.zjdiepu.www.dao.dh.FkInsureListMapper;
import com.zjdiepu.www.dao.dz.DzGpsListMapper;
import com.zjdiepu.www.dao.dz.DzPickCarMapper;
import com.zjdiepu.www.dao.fk.FkAuditListMapper;
import com.zjdiepu.www.dao.fk.FkPreAuditInfoMapper;
import com.zjdiepu.www.dao.other.OtherAuditInfoMapper;
import com.zjdiepu.www.dao.other.OtherWantWarningMapper;
import com.zjdiepu.www.dao.partner.ThBusinessRecordMapper;
import com.zjdiepu.www.dao.partner.ThYwBusinessMapper;
import com.zjdiepu.www.dao.system.BaseBusiUnitMapper;
import com.zjdiepu.www.dao.system.BaseCustomerMapper;
import com.zjdiepu.www.dao.system.BaseSalersmanMapper;
import com.zjdiepu.www.dao.yw.YwBusinessCarMapper;
import com.zjdiepu.www.dao.yw.YwBusinessExtrasMapper;
import com.zjdiepu.www.dao.yw.YwBusinessLoanMapper;
import com.zjdiepu.www.dao.yw.YwBusinessMapper;
import com.zjdiepu.www.dao.yw.YwFeesMapper;
import com.zjdiepu.www.dao.yw.YwTransferMapper;
import com.zjdiepu.www.dao.zpp.FengKongShenHeDao;
import com.zjdiepu.www.dao.zpp.PublicDao;
import com.zjdiepu.www.ibiz.cache.ICachedDictionaryService;
import com.zjdiepu.www.ibiz.file.IQiniuFileService;
import com.zjdiepu.www.ibiz.other.IOtherWarningConfigurationService;
import com.zjdiepu.www.ibiz.partner.IThYwBusinessRequestService;
import com.zjdiepu.www.ibiz.system.IBaseSysParamsService;
import com.zjdiepu.www.ibiz.system.IOtherHolidaysService;
import com.zjdiepu.www.ibiz.zpp.FengKongShenHeService;
import com.zjdiepu.www.ibiz.zpp.SystemService;
import com.zjdiepu.www.model.base.dto.DpBaseDealerInfo;
import com.zjdiepu.www.model.cw.dto.CwRemitAdjustB;
import com.zjdiepu.www.model.cw.dto.CwRemitAdjustbSub;
import com.zjdiepu.www.model.dh.dto.DhDepositMoney;
import com.zjdiepu.www.model.dh.dto.DhInsteadPayment;
import com.zjdiepu.www.model.dz.dto.DzGpsList;
import com.zjdiepu.www.model.dz.dto.DzPickCar;
import com.zjdiepu.www.model.fk.dto.FkAuditList;
import com.zjdiepu.www.model.fk.dto.FkPreAuditInfo;
import com.zjdiepu.www.model.fk.ext.FkAuditListExt;
import com.zjdiepu.www.model.other.dto.OtherAuditInfo;
import com.zjdiepu.www.model.other.dto.OtherMessageApp;
import com.zjdiepu.www.model.other.dto.OtherWantWarning;
import com.zjdiepu.www.model.other.dto.OtherWarningConfiguration;
import com.zjdiepu.www.model.partner.dto.ThBusinessRecord;
import com.zjdiepu.www.model.partner.dto.ThYwBusiness;
import com.zjdiepu.www.model.system.dto.BaseCustomer;
import com.zjdiepu.www.model.yw.dto.YwBusiness;
import com.zjdiepu.www.model.yw.dto.YwBusinessCar;
import com.zjdiepu.www.model.yw.dto.YwBusinessExtras;
import com.zjdiepu.www.model.yw.dto.YwBusinessLoan;
import com.zjdiepu.www.model.yw.dto.YwFees;
import com.zjdiepu.www.model.yw.dto.YwTransfer;
import com.zjdiepu.www.model.zpp.fksh.dto.FengKongShenHeV001ZiDongExe;
import com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt;
import com.zjdiepu.www.model.zpp.fksh.vo.FkAuditListVo;
import com.zjdiepu.www.model.zpp.fksh.vo.OtherAuditInfoListVo;
import com.zjdiepu.www.model.zpp.fksh.vo.YwBusinessExtrasVo;
import com.zjdiepu.www.model.zpp.pub.ext.WhereSqlExt;

  

/**      
 * 项目名称：diepu-parent-biz   
 * 类名称：FengKongShenHeServiceImpl   
 * 类描述：   
 * 创建人：zhangpp
 * 创建时间：2017年5月26日 上午10:36:55   
 * 修改人：zhangpp
 * 修改时间：2017年5月26日 上午10:36:55   
 * 修改备注：   
 * @version V1.0     
 */
@Service
public class FengKongShenHeServiceImpl implements FengKongShenHeService
{
	private static final Logger logger = LoggerFactory.getLogger(FengKongShenHeServiceImpl.class);
	
	@Autowired
	private YwFeesMapper ywFeesMapper;
	
	@Autowired
	private IQiniuFileService qiniuFileService;
	
	@Autowired
	private IOtherWarningConfigurationService otherWarningConfigurationService;
	@Autowired
	private IThYwBusinessRequestService thYwBusinessRequestService;
	
	@Autowired
	private PublicDao publicDao;
	
	//审核路径
	private String serveRealPath;
	
	@Autowired
	private SystemService systemService;
	
	@Autowired
	private FengKongShenHeDao fengKongShenHeDao;
	
	@Autowired
	private OtherAuditInfoMapper otherAuditInfoMapper;
	
	@Autowired
	private YwBusinessMapper  ywBusinessMapper;
	
	@Autowired
	private FkAuditListMapper fkAuditListMapper;
	
	@Autowired
    private ServiceHelper serviceHelper;
	
	@Autowired
    private ICachedDictionaryService cachedDictionaryService;
	
	@Autowired
	private DpBaseDealerInfoMapper dpBaseDealerInfoMapper;
	
	@Autowired
	private YwBusinessExtrasMapper ywBusinessExtrasMapper;
	
	@Autowired
	private IBaseSysParamsService baseSysParamsService;
	
	@Autowired
	private YwTransferMapper ywTransferMapper;
	
	@Autowired
	private FkInsureListMapper fkInsureListMapper;
	
	@Autowired
	private DzGpsListMapper dzGpsListMapper;
	
	@Autowired
	private DhAdvanceMapper dhAdvanceMapper;
	
	@Autowired
	private DhArchiveMapper dhArchiveMapper;
	
	@Autowired
	private DhDepositMoneyMapper dhDepositMoneyMapper;
	
	@Autowired
	private DhInsteadPaymentMapper dhInsteadPaymentMapper;
	
	@Autowired
	private DzPickCarMapper dzPickCarMapper;
	
	@Autowired
	private RedisObjectClient redisObjectClient;
	
	@Autowired
	private BaseSalersmanMapper baseSalersmanMapper;
	
	@Autowired
	private BaseCustomerMapper baseCustomerMapper;
	
	@Autowired
	private BaseBusiUnitMapper baseBusiUnitMapper;
	
	@Autowired
	private OtherWantWarningMapper otherWantWarningMapper;
	
	@Autowired
	private YwBusinessCarMapper ywBusinessCarMapper;
	
	@Autowired
	private IOtherHolidaysService otherHolidaysService;
	
	@Autowired
	private FkPreAuditInfoMapper fkPreAuditInfoMapper;
	
	@Autowired
	private CwRemitAdjustBMapper cwRemitAdjustBMapper;
	
	@Autowired
	private CwRemitAdjustbSubMapper cwRemitAdjustbSubMapper;
	
	@Autowired
	private YwBusinessLoanMapper ywBusinessLoanMapper;
	
	@Autowired
	private ThBusinessRecordMapper thBusinessRecordMapper;
	
	@Autowired
	private ThYwBusinessMapper thYwBusinessMapper;
	
	@Autowired
	private DhOverdueListMapper dhOverdueListMapper;
	
	
	
	/* 
	* @author zhangpp
	* <p>Title: getAuditListVo</p> 
	* <p>Description: </p> 
	* @param paramsExt
	* @return 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#getAuditListVo(com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt) 
	* @version V1.0
	*/
	@Override
	public List<FkAuditListVo> getAuditListVo(ParamsExt paramsExt) {
		
		return fengKongShenHeDao.getAuditListVo(paramsExt);
	}

	/* 
	* @author zhangpp
	* <p>Title: getAuditListVoCount</p> 
	* <p>Description: </p> 
	* @param paramsExt
	* @return 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#getAuditListVoCount(com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt) 
	* @version V1.0
	*/
	@Override
	public int getAuditListVoCount(ParamsExt paramsExt) {
		
		return fengKongShenHeDao.getAuditListVoCount(paramsExt);
	}

	/* 
	* @author zhangpp
	* <p>Title: getOtherAuditInfoListVo</p> 
	* <p>Description: </p> 
	* @param paramsExt
	* @return 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#getOtherAuditInfoListVo(com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt) 
	* @version V1.0
	*/
	@Override
	public List<OtherAuditInfoListVo> getOtherAuditInfoListVo(
			ParamsExt paramsExt) {
		
		return fengKongShenHeDao.getOtherAuditInfoListVo(paramsExt);
	}

	/* 
	* @author zhangpp
	* <p>Title: getYwBusinessExtrasVo</p> 
	* <p>Description: </p> 
	* @param paramsExt
	* @return 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#getYwBusinessExtrasVo(com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt) 
	* @version V1.0
	*/
	@Override
	public List<YwBusinessExtrasVo> getYwBusinessExtrasVo(ParamsExt paramsExt) {
		
		return fengKongShenHeDao.getYwBusinessExtrasVo(paramsExt);
	}

	/* 
	* @author zhangpp
	* <p>Title: ziLiaoBuqiShenHeGuoShen</p> 
	* <p>Description: </p> 
	* @param currentUser
	* @param otherAuditInfo
	* @param paramsExt 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#ziLiaoBuqiShenHeGuoShen(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.other.dto.OtherAuditInfo, com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt) 
	* @version V1.0
	*/
	@Override
	public void diepuZiLiaoBuqiShenHeGuoShen(AbstractSysUser currentUser,
			OtherAuditInfo otherAuditInfo, ParamsExt paramsExt) {
		
		
		if(null == paramsExt && ("").equals(paramsExt))
		{
			throw new BaseException(ResultFlagType.PARAM_EMPTY.getCode().toString(),ResultFlagType.PARAM_EMPTY.getValue());
		}
		
		String userId = currentUser.getId();
		String creatorName = currentUser.getName();
		
		//审核通过  插入other_audit_info 一条数据     业务信息表状态改成 30   模块编号M_zlbqsh
		if(paramsExt.getExamineStatus().equals("ok"))
		{
			//插入 审批记录表  other_audit_info
			otherAuditInfo.initInsertData(userId, creatorName);
			otherAuditInfo.setModeId("M_zlbqsh");
			otherAuditInfo.setAuditName("资料补齐补审");
			otherAuditInfo.setAuditStatusValueType("busi_status");
			otherAuditInfo.setAuditStatusValue(30);
			otherAuditInfo.setAuditStatus("过审资料补齐");
			otherAuditInfo.setPreAuditStatusType("busi_status");
			otherAuditInfo.setPreAuditStatusValue(10);
			otherAuditInfo.setPreAuditStatus("欠资料");
			otherAuditInfoMapper.insert(otherAuditInfo);
			
			//业务信息主键
			String busiId = otherAuditInfo.getDataId();
			
			//修改业务信息表状态值
			YwBusiness ywBusiness = new YwBusiness();
			ywBusiness.setId(busiId);
			ywBusiness.setBusiStatus(30);
			ywBusiness.setTimeAuditFinish(new Date());
			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
			}
			return;
		}
		
		//审核不通过   插入 审批记录表  other_audit_info   信息表状态改成  9070
		
		//插入 审批记录表  other_audit_info
		otherAuditInfo.initInsertData(userId, creatorName);
		otherAuditInfo.setModeId("M_zlbqsh");
		otherAuditInfo.setAuditName("资料补齐补审");
		otherAuditInfo.setAuditStatusValueType("busi_status");
		otherAuditInfo.setAuditStatusValue(9070);
		otherAuditInfo.setAuditStatus("不过审资料补齐");
		otherAuditInfo.setPreAuditStatusType("busi_status");
		otherAuditInfo.setPreAuditStatusValue(10);
		otherAuditInfo.setPreAuditStatus("欠资料");
		otherAuditInfoMapper.insert(otherAuditInfo);
		
		//业务信息主键
		String busiId = otherAuditInfo.getDataId();
		
		//修改业务信息表状态值
		YwBusiness ywBusiness = new YwBusiness();
		ywBusiness.setId(busiId);
		ywBusiness.setBusiStatus(9070);
		ywBusiness.setTimeAuditFinish(new Date());
		ywBusiness.setTimeAuditFinish(new Date());
		int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
		if(updateCount == 0)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
		else if(updateCount > 1)
		{
			throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
		}
	}
	
	/* 
	* @author zhangpp
	* <p>Title: fengKongShenTrsh</p> 
	* <p>Description: </p> 
	* @param currentUser
	* @param paramsExt 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#fengKongShenTrsh(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.fk.dto.FkAuditList, com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt) 
	* @version V1.0
	*/
	@Override
	public void diepuFengKongShenTrsh(AbstractSysUser currentUser,String busiId,String modeId) 
	{
		
		if(null == currentUser || ("").equals(currentUser))
		{
			throw new BaseException(ResultFlagType.LOGIN_TIMEOUT.getCode().toString(),ResultFlagType.LOGIN_TIMEOUT.getValue());
		}
		
		//业务信息表的主键
		if(null == busiId || ("").equals(busiId))
		{
			throw new BaseException(ResultFlagType.PARAM_EMPTY.getCode().toString(),ResultFlagType.PARAM_EMPTY.getValue());
		}
		
		//查询待审批列表信息
		FkAuditList  fkAuditList = new FkAuditList();
		fkAuditList.setBusiId(busiId);
		fkAuditList.setModeId("M_csdcs");
		fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
		if(null == fkAuditList || ("").equals(fkAuditList))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		}
		
		String userId = currentUser.getId();
		String creatorName = currentUser.getName();
		if(null == userId || ("").equals(userId))
		{
			throw new BaseException(ResultFlagType.LOGIN_TIMEOUT.getCode().toString(),ResultFlagType.LOGIN_TIMEOUT.getValue());
		}
		if(null == creatorName || ("").equals(creatorName))
		{
			throw new BaseException(ResultFlagType.LOGIN_TIMEOUT.getCode().toString(),ResultFlagType.LOGIN_TIMEOUT.getValue());
		}
		
		//当前要执行的模块编号
		if(null == modeId || ("").equals(modeId))
		{
			throw new BaseException(ResultFlagType.PARAM_EMPTY.getCode().toString(),ResultFlagType.PARAM_EMPTY.getValue());
		}
		
		fkAuditList.setModeId(modeId);
		fkAuditList.initInsertData(userId, creatorName);
		fkAuditList.setStatusList(1);
		fkAuditList.setOperatorId("");
		fkAuditList.setOperatorName("");
		fkAuditList.setAuditDetail("");
		fkAuditList.setAuditPostil("");
		int insertCount = fkAuditListMapper.insert(fkAuditList);
		if(insertCount == 0)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),ResultFlagType.FAIL.getValue());
		} 
		else if(insertCount > 1)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),ResultFlagType.FAIL.getValue());
		}
	}

	/* 
	* @author zhangpp
	* <p>Title: fengKongShenHeModify</p> 
	* <p>Description: </p> 
	* @param currentUser
	* @param fkAuditList
	* @param ywBusiness
	* @param paramsExt 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#fengKongShenHeModify(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.fk.dto.FkAuditList, com.zjdiepu.www.model.yw.dto.YwBusiness, com.zjdiepu.www.model.zpp.fksh.ext.ParamsExt) 
	* @version V1.0
	*/
	@Override
	public void diepuFengKongShenHeModify(AbstractSysUser currentUser,FkAuditList fkAuditList,YwBusiness ywBusiness,OtherAuditInfo otherAuditInfo,ParamsExt paramsExt,String serverRealPath)
	{
		
		
		if(null == currentUser || ("").equals(currentUser))
		{
			throw new BaseException(ResultFlagType.LOGIN_TIMEOUT.getCode().toString(),ResultFlagType.LOGIN_TIMEOUT.getValue());
		}
		
		//审核路径
		serveRealPath = serverRealPath;
		
		//根据事件的名称  去配置表里面找  关联起来  执行那些方法函数
		//审核结果：通过(Pass)，不通过（Fail），退回修改(EditBack)，退回审核（AuditBack）
		
		//审核模块   按模块来写开     执行过程中进行判断来维护  整个审核的流程
		
		if(null == paramsExt || ("").equals(paramsExt))
		{
			throw new BaseException(ResultFlagType.PARAM_EMPTY.getCode().toString(),ResultFlagType.PARAM_EMPTY.getValue());
		}
		
		//模块标识
		String modeId = paramsExt.getModeId();
		//模块标识
		
		if(null == modeId || ("").equals(modeId))
		{
			throw new BaseException(ResultFlagType.PARAM_EMPTY.getCode().toString(),ResultFlagType.PARAM_EMPTY.getValue());
		}
		
		//执行事件标识
		String event = paramsExt.getEvent();
		//执行事件标识
		
		//待审核列表的主键   
		String replaceId = paramsExt.getReplaceId();
		if(null == replaceId || ("").equals(replaceId))
		{
			throw new BaseException(ResultFlagType.PARAM_EMPTY.getCode().toString(),ResultFlagType.PARAM_EMPTY.getValue());
		}
		
		//业务信息表的主键
		String busiId = paramsExt.getBusiId();
		if(null == busiId || ("").equals(busiId))
		{
			throw new BaseException(ResultFlagType.PARAM_EMPTY.getCode().toString(),ResultFlagType.PARAM_EMPTY.getValue());
		}
		
		//操作人的信息
		String operatorId = currentUser.getId();
		String operatorName = currentUser.getName();
		if(null == operatorId || ("").equals(operatorId))
		{
			throw new BaseException(ResultFlagType.LOGIN_TIMEOUT.getCode().toString(),ResultFlagType.LOGIN_TIMEOUT.getValue());
		}
		if(null == operatorName || ("").equals(operatorName))
		{
			throw new BaseException(ResultFlagType.LOGIN_TIMEOUT.getCode().toString(),ResultFlagType.LOGIN_TIMEOUT.getValue());
		}
		
		//如果是资审单一审审则把状态改成不欠资料的  
		String tuModeId = paramsExt.getTuModeId();
		if(null != tuModeId && tuModeId.equals("M_zsys"))
		{
			YwBusiness business = new YwBusiness();
			business.setId(busiId);
			business.setLessInformationStatus(20);
			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(business);
			if(updateCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
		}
		
		//操作人信息
		//String userId = currentUser.getId();
		//String creatorName = currentUser.getName();
		
		//查询业务信息表的数据
		//String whereSql = " and t.id = '"+busiId+"'";
		//paramsExt.setWhereSql(whereSql);
		//FengKongShenHeDataVo ywbus = fengKongShenHeDao.getYwFkshDataVo(paramsExt);
		//if(null == ywbus || ("").equals(ywbus))
		//{
		//	throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		//}
		
		
		//当前的时间
		//Date date = ZhppDateUtil.strToTimestamp(ZhppDateUtil.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
		//经销商
		//String dealer = ywbus.getDealerName();
		//部门
		//String departmentName = ywbus.getOrgName();
		//业务员
		//String salersmanName = ywbus.getSalesmanName();
		//客户姓名
		//String cusName = ywbus.getCustomerName();
		//客户身份证
		//String cusIdno = ywbus.getCustomerNo();
		//银行
		//String bankname = cachedDictionaryService.getName(ywbus.getBankLoan(), DataDicType.LOAN_BANK);
		//贷款额
		//double loanAmount = ywbus.getRealLoanAmount();
		
		
		//公用插入的值  插入待审批列表数据信息
		//fkAuditList.setBusiId(busiId);
		//fkAuditList.setBusiConfirmTime(date);
		//fkAuditList.setChannelStatus(10);
		//fkAuditList.setChannelStatusName("无");
		//fkAuditList.setChannelType("10");
		//fkAuditList.setChannelTypeName("普通通道");
		//fkAuditList.setDealer(dealer);
		//fkAuditList.setDepartmentName(departmentName);
		//fkAuditList.setSalersmanName(salersmanName);
		//fkAuditList.setCusName(cusName);
		//fkAuditList.setCusIdno(cusIdno);
		//fkAuditList.setBankname(bankname);
		//fkAuditList.setOperateStatus(0);
		//fkAuditList.setOperatorId(operatorId);
		//fkAuditList.setOperatorName(operatorName);
		//fkAuditList.setAcceptDate(date);
		//fkAuditList.setAssigningTaskType(01);
		//fkAuditList.setStatusList(1);
		//fkAuditList.setLoanAmount(loanAmount);
		//公用插入的值  插入待审批列表数据信息
		
		//查询待审批列表的数据进行复制插入
		fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
		if(null == fkAuditList || ("").equals(fkAuditList))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		}
		fkAuditList.setOperatorId("");
		fkAuditList.setOperatorName("");
		
		//查询业务信息表数据
		ywBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
		if(null == ywBusiness || ("").equals(ywBusiness))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		}
		
		//公用的插入字段  审批记录表
		otherAuditInfo.setModeId(modeId);
		otherAuditInfo.setDataId(replaceId);
		//公用的插入字段  审批记录表
		
		if(null != tuModeId && tuModeId.equals("M_csdcs") || modeId.equals("M_csdzs"))
		{
			fkshTuiHui(modeId,busiId);
		}
		
		modify(currentUser,fkAuditList,ywBusiness,otherAuditInfo,modeId,event,tuModeId);
		
		if(StringUtils.isNotBlank(tuModeId))
		{
			if(tuModeId.equals("M_csdcs") || tuModeId.equals("M_csdzs"))
			{
				//通知 发短息
				//noticeFkshReturn(busiId,fkAuditList.getId(),tuModeId,currentUser);
			}
		}
	}
	
	
	//通知 发短息
	@SuppressWarnings("unused")
	private void noticeFkshReturn(String busiId,String dataId,String modeId,AbstractSysUser currentUser)
	{
    	//查询业务信息表
    	YwBusiness ywBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
    	if(null == ywBusiness)
    	{
    		return;
    	}
    	
    	OtherAuditInfo otherAuditInfo = new OtherAuditInfo();
    	otherAuditInfo.setBusiId(busiId);
    	otherAuditInfo.setModeId(modeId);
    	otherAuditInfo.setDpStatus(1);
    	otherAuditInfo = otherAuditInfoMapper.selectRefined(otherAuditInfo);
    	if(null == otherAuditInfo || ("").equals(otherAuditInfo))
    	{
    		return;
    	}
    	
//    	DzGpsList dzGpsList = new DzGpsList();
//    	dzGpsList.setBusiId(busiId);
//    	dzGpsList.setDpStatus(1);
//    	dzGpsList = dzGpsListMapper.selectRefined(dzGpsList);
//    	if(null == dzGpsList)
//    	{
//    		return;
//    	}
    	
    	//用户名称
    	String customerName = ywBusiness.getCustomerName();
    	
    	//征信预警通知
		OtherMessageApp otherMessageApp_ = new OtherMessageApp();
		otherMessageApp_.setModeId(ModeIDType.TC.getCode());
		otherMessageApp_.setBusiId(busiId);
		otherMessageApp_.setDataid(dataId);
		otherMessageApp_.setTypeMsg("01");
		otherMessageApp_.setTypeMsgEvent(NewsType.TZ27.getCode());
		otherMessageApp_.setNotificationBar(customerName + "风控阶段订单退回");
		otherMessageApp_.setTitle(customerName + "风控审核结果：退回");
		otherMessageApp_.setContent("通知：" + customerName + "风控审核结果：退回 备注："+otherAuditInfo.getRemarks());
		Date now = new Date();
		otherMessageApp_.setTimeCreate(now);
		otherMessageApp_.setTimeSend(now);
		otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
		String shortMessage_ = "客户" + customerName +"风控审核结果：退回，请登录系统查看详情！";
		serviceHelper.saveMsg(otherMessageApp_, ywBusiness.getSalesmanId(), customerName, shortMessage_, currentUser, logger);
		//征信预警通知
	}
	
	//退回
	private void fkshTuiHui(String modeId,String busiId)
	{
		String sqlXmls = "update fk_audit_list t set t.status_list = 4 where t.busi_id = '"+busiId+"' and t.status_list = 1 and t.dp_status = 1";
		int count = publicDao.updateWhereSqlXmls(sqlXmls);
		if(count < 1)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),ResultFlagType.FAIL.getValue());
		}
	}
	
	private String mod = "";
	
	
	//风控审核 
	private void modify(AbstractSysUser currentUser,FkAuditList fkAuditList,YwBusiness ywBusiness,OtherAuditInfo otherAuditInfo,String modeId,String event,String tuModeId)
	{
		try 
		{
			JsonParser parse =new JsonParser();  
//			JsonObject json = (JsonObject) parse.parse(new FileReader("C://fkshConf.json")); 
//			JsonObject json = (JsonObject) parse.parse(new FileReader("/data/www/configure/fkshConf.json")); 
			JsonObject json = (JsonObject) parse.parse(new FileReader(serveRealPath)); 
			JsonArray  array = json.get("result").getAsJsonArray();
			
			if(null == array || 0 == array.size())
			{
				return;
			}
			
			//循环配置
			for(int i=0;i<array.size();i++)
			{
				JsonObject object = array.get(i).getAsJsonObject();
				
				//模块编号
				String mode_Id = object.get("modeId").getAsString();
				
				if(modeId.equals(mode_Id))
				{
					//判断是否为过审
					if(event.equals("pass"))
					{
						pass(currentUser,fkAuditList,ywBusiness,otherAuditInfo,object);
						break;
					}
					
					if(event.equals("fail"))
					{
						fail(currentUser,fkAuditList,ywBusiness,otherAuditInfo,object);
						break;
					}
					
					if(event.equals("editBack"))
					{
						editback(currentUser,fkAuditList,ywBusiness,otherAuditInfo,object,tuModeId);
						break;
					}
					
					if(event.equals("lesspass"))
					{
						
						Lesspass(currentUser,fkAuditList,ywBusiness,otherAuditInfo,object);
					}
				}
			}
			
			//退回执行的 自动审核事件
			if(null != tuModeId && null != modeId)
			{
				event = "pass"; 
			}
			
			//循环配置
			for(int i=0;i<array.size();i++)
			{
				//返回   审核不过按钮 则不执行
				if(event.equals("editBack") || event.equals("fail"))
				{
					continue;
				}
				
				//当前的对象
				JsonObject object = array.get(i).getAsJsonObject();
				//模块编号
				String mode_Id = object.get("modeId").getAsString();
				
				//如果是通融审核就不自动审批
				if(!modeId.equals("M_trsh"))
				{
					//自动审核条件调用
					
					mod = modeId;
					
					zidongShenData(currentUser,object,fkAuditList,ywBusiness);
					
					//执行自动审核
					auditListUpdate(currentUser,object,fkAuditList,ywBusiness);
				}
				
				
				//额外事件  电审二审 资审二审
				if(mode_Id.equals("M_dsfs") || mode_Id.equals("M_zses"))
				{
					dianShenZiShenevent(object,currentUser,ywBusiness,fkAuditList);
				}
				
				//生成欠资料审核资料
				if(event.equals("lesspass"))
				{
					//生成欠资料过审
					shengchengZlbqsh(object,currentUser,fkAuditList);
				}
				
				//通融审批
				if(event.equals("pass") && modeId.equals("M_trsh"))
				{
					tongRongShenPi(currentUser,fkAuditList,ywBusiness,otherAuditInfo,modeId,event);
				}
				
				//额外事件
				shengchengewaishijian(object,currentUser,fkAuditList);
				
			}
		} 
		catch (Exception e) 
		{
			
			e.printStackTrace();
		}
	}
	
	//额外事件
	private void shengchengewaishijian(JsonObject object,AbstractSysUser currentUser,FkAuditList fkAuditList)
	{
		
		//下个模块
		JsonArray  addArray = object.get("additional").getAsJsonArray();
		if(null == addArray || ("").equals(addArray))
		{
			return;
		}
		
		String userId = currentUser.getId();
		String creatorName = currentUser.getName();
		
		for(int i=0;i<addArray.size();i++)
		{
			JsonObject objs = addArray.get(i).getAsJsonObject();
			
			//事件
			String addEvent = objs.get("addEvent").getAsString();
			
			//业务主键
			String busiId = fkAuditList.getBusiId();
			
			//业务信息表数据
			YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
			
			if(null == business || ("").equals(business))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"business is null");
			}
			
			
			if(addEvent.equals("buildModeID"))
			{
				String modeId = objs.get("modeId").getAsString();
				
				String channelType = objs.get("channelType").getAsString();
				
				if(null != channelType && !("").equals(channelType))
				{
					if(fkAuditList.getChannelType().equals(channelType))
					{
						
						if(business.getBusiStatus() < 50)
						{
							continue;
						}
						
						FkAuditList auditList = new FkAuditList();
						auditList.setBusiId(busiId);
						auditList.setStatusList(1);
						auditList.setModeId(modeId);
						auditList = fkAuditListMapper.selectRefined(auditList);
						
						if(null != auditList && !("").equals(auditList))
						{
							continue;
						}
						
						auditList = new FkAuditList();
						auditList.setBusiId(busiId);
						auditList.setStatusList(2);
						auditList.setModeId(modeId);
						auditList = fkAuditListMapper.selectRefined(auditList);
						
						if(null != auditList && !("").equals(auditList))
						{
							continue;
						}
						
						fkAuditList.initInsertData(userId, creatorName);
						fkAuditList.setModeId(modeId);
						fkAuditList.setStatusList(1);
						fkAuditList.setOperatorName("");
						fkAuditList.setOperatorId("");
						fkAuditList.setAuditPostil("");
						fkAuditList.setAuditDetail("");
						int inserCount = fkAuditListMapper.insert(fkAuditList);
						if(inserCount < 1)
						{
							throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
						} 
					}
				}
			}
			else if(addEvent.equals("addEventBusiStatus"))
			{
				//查询业务信息表
				YwBusiness ywBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
				if(null == ywBusiness || ("").equals(ywBusiness))
				{
					return;
				}
				
				String car_type = ywBusiness.getCarType();
				
				//风控总监审核之后才可以修改状态   这个逻辑不要了
				if(ywBusiness.getBusiStatus() == 110)
				{
					//增加【如果 yw_业务信息_附加信息 对应的gps个数大于0，则往‘dz_gps待加装列表’增加一条数据，GPS待加装信息状态为‘未提交’】
//					String sqlXmls = "select t.id from yw_business_extras t where t.busi_id = '"+busiId+"' and t.dp_status = 1";
//					List<Map<String, String>> list = publicDao.queryWhereSql(sqlXmls);
//					if(null != list && list.size() > 0)
//					{
//						DpBaseDealerInfo dpBaseDealerInfo = dpBaseDealerInfoMapper.selectByPrimaryKey(business.getDealerId());
//						if(null == dpBaseDealerInfo || ("").equals(dpBaseDealerInfo))
//						{
//							throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dpBaseDealerInfo is null");
//						}
//						
//						DzGpsList dzGpsList = new DzGpsList();
//						dzGpsList.setBusiId(busiId);
//						dzGpsList.setDpStatus(1);
//						dzGpsList = dzGpsListMapper.selectRefined(dzGpsList);
//						
//						if(null == dzGpsList || ("").equals(dzGpsList))
//						{
//							dzGpsList = new DzGpsList();
//							dzGpsList.initInsertData(userId, creatorName);
//							dzGpsList.setBusiId(busiId);
//							dzGpsList.setCusId(business.getCustomerId());
//							dzGpsList.setLoanAmount(business.getRealLoanAmount());
//							dzGpsList.setChannelType(business.getChannelType());
//							dzGpsList.setChannelTypeName(iCachedDictionaryService.getName(business.getChannelType(), DataDicType.CHANNEL_TYPE));
//							dzGpsList.setDealerLevel(iCachedDictionaryService.getName(dpBaseDealerInfo.getDealerLevel(), DataDicType.DEALER_LEVEL));
//							dzGpsList.setDealer(fkAuditList.getDealer());
//							dzGpsList.setDepartmentName(fkAuditList.getDepartmentName());
//							dzGpsList.setSalersmanName(fkAuditList.getSalersmanName());
//							dzGpsList.setCusName(business.getCustomerName());
//							dzGpsList.setCusIdno(business.getCustomerNo());
//							dzGpsList.setNumGps(list.size());
//							dzGpsList.setStatusGpsList(10);
//							dzGpsList.setBankname(fkAuditList.getBankname());
//							int inserCount = dzGpsListMapper.insert(dzGpsList);
//							if(inserCount < 1)
//							{
//								throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert dzGpsList fail");
//							} 
//						}
//					}
					
					//二手车   过户中
					if(null != car_type && !("").equals(car_type) && car_type.equals("02"))
					{
						ywBusiness.setBusiStatus(200);
						int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
						if(updateCount < 1)
						{
							throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
						} 
					}
					
					//如果是新车，将业务信息状态更改为“申请垫资中”（原先为审批完成） 
//					if(null != car_type && !("").equals(car_type) && car_type.equals("01"))
//					{
//						ywBusiness.setBusiStatus(250);
//						int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
//						if(updateCount < 1)
//						{
//							throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
//						} 
//					}
				}
			}
			else if(addEvent.equals("fkshgpscl"))
			{
//				String sqlXmls = "select t.id from yw_business_extras t where t.busi_id = '"+busiId+"' and t.dp_status = 1";
//				List<Map<String, String>> list = publicDao.queryWhereSql(sqlXmls);
//				
//				if(null != list && list.size() > 0)
//				{
//					//查询经销商的数据
//					DpBaseDealerInfo dpBaseDealerInfo = dpBaseDealerInfoMapper.selectByPrimaryKey(business.getDealerId());
//					if(null == dpBaseDealerInfo || ("").equals(dpBaseDealerInfo))
//					{
//						throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dpBaseDealerInfo is null");
//					}
//					
//					DzGpsList dzGpsList = new DzGpsList();
//					dzGpsList.setBusiId(busiId);
//					dzGpsList.setDpStatus(1);
//					dzGpsList = dzGpsListMapper.selectRefined(dzGpsList);
//					
//					if(null == dzGpsList || ("").equals(dzGpsList))
//					{
//						dzGpsList = new DzGpsList();
//						dzGpsList.initInsertData(userId, creatorName);
//						dzGpsList.setBusiId(busiId);
//						dzGpsList.setCusId(business.getCustomerId());
//						dzGpsList.setLoanAmount(business.getRealLoanAmount());
//						dzGpsList.setChannelType(business.getChannelType());
//						dzGpsList.setChannelTypeName(iCachedDictionaryService.getName(business.getChannelType(), DataDicType.CHANNEL_TYPE));
//						dzGpsList.setDealerLevel(iCachedDictionaryService.getName(dpBaseDealerInfo.getDealerLevel(), DataDicType.DEALER_LEVEL));
//						dzGpsList.setDealer(fkAuditList.getDealer());
//						dzGpsList.setDepartmentName(fkAuditList.getDepartmentName());
//						dzGpsList.setSalersmanName(fkAuditList.getSalersmanName());
//						dzGpsList.setCusName(business.getCustomerName());
//						dzGpsList.setCusIdno(business.getCustomerNo());
//						dzGpsList.setNumGps(list.size());
//						dzGpsList.setStatusGpsList(10);
//						dzGpsList.setBankname(fkAuditList.getBankname());
//						int inserCount = dzGpsListMapper.insert(dzGpsList);
//						if(inserCount < 1)
//						{
//							throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert dzGpsList fail");
//						} 
//					}
//					
//					FkInsureList fkInsureList = new FkInsureList();
//					fkInsureList.setBusiId(busiId);
//					fkInsureList.setDpStatus(1);
//					fkInsureList = fkInsureListMapper.selectRefined(fkInsureList);
//					if(null == fkInsureList || ("").equals(fkInsureList))
//					{
//						fkInsureList = new FkInsureList();
//						fkInsureList.initInsertData(userId, creatorName);
//						fkInsureList.setCusId(business.getCustomerId());
//						fkInsureList.setBusiId(busiId);
//						fkInsureList.setLoanAmount(business.getRealLoanAmount());
//						fkInsureList.setChannelType(business.getChannelType());
//						fkInsureList.setChannelTypeName(iCachedDictionaryService.getName(business.getChannelType(), DataDicType.CHANNEL_TYPE));
//						fkInsureList.setDealerLevel(dpBaseDealerInfo.getDealerLevel());
//						fkInsureList.setDealer(business.getDealerId());
//						fkInsureList.setDepartmentName(fkAuditList.getDepartmentName());
//						fkInsureList.setSalersmanName(fkAuditList.getSalersmanName());
//						fkInsureList.setCusName(business.getCustomerName());
//						fkInsureList.setCusIdno(business.getCustomerNo());
//						fkInsureList.setOperatorId(userId);
//						fkInsureList.setOperatorName(creatorName);
//						fkInsureList.setAcceptDate(new Date());
//						fkInsureList.setInsuranceStatus(10);
//						
//						//获取档案编号
//						DhArchive dhArchive = new DhArchive();
//						dhArchive.setBusiId(busiId);
//						dhArchive.setDpStatus(1);
//						dhArchive = dhArchiveMapper.selectRefined(dhArchive);
//						if(null != dhArchive && !("").equals(dhArchive))
//						{
//							fkInsureList.setNoRecord(dhArchive.getNoRecord());
//						}
//						
//						int inserCount = fkInsureListMapper.insert(fkInsureList);
//						if(inserCount < 1)
//						{
//							throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert fkInsureList fail");
//						} 
//					}
//				}
//				
				//过户时间   挪到 业务信息时间
				
				//查询过户时间
				YwTransfer ywTransfer = new YwTransfer();
				ywTransfer.setBusiId(busiId);
				ywTransfer.setDpStatus(1);
				ywTransfer = ywTransferMapper.selectRefined(ywTransfer);
				if(null != ywTransfer && !("").equals(ywTransfer))
				{
					 //过户时间
					 Date date_transfer = ywTransfer.getDateTransfer();
					 
					 //业务信息表时间更新
					 YwBusiness ywBusiness = new YwBusiness();
					 ywBusiness.setId(busiId);
					 ywBusiness.setPickCarTime(date_transfer);
					 int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
					 if(updateCount < 1)
					 {
						throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
					 } 
				}
				
				//增加：将业务信息状态更改为“申请垫资中”
//				YwBusiness ywBusiness = new YwBusiness();
//				ywBusiness.setId(busiId);
//				ywBusiness.setBusiStatus(250);
//				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
//				if(updateCount < 1)
//				{
//					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
//				}
			}
		}
		
		for(int i=0;i<addArray.size();i++)
		{
			JsonObject objs = addArray.get(i).getAsJsonObject();
			
			//事件
			String addEvent = objs.get("addEvent").getAsString();
			
			//上级的来源名称
			String pName = object.get("pName").getAsString();
			
			String md = object.get("modeId").getAsString();
			
			
			//业务主键
			String busiId = fkAuditList.getBusiId();
			
			//业务信息表数据
			YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
			
			if(null == business || ("").equals(business))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"business is null");
			}
			
			FkAuditList ad = new FkAuditList();
			ad.setBusiId(busiId);
			ad.setModeId(md);
			ad.setDpStatus(1);
			ad = fkAuditListMapper.selectRefined(ad);
			if(null != ad && ad.getStatusList() != 2)
			{
				continue;
			}
			
			if(addEvent.equals("fkshtytz"))
			{
				String modeId = object.get("modeId").getAsString();
				
				if(modeId.equals("M_csdzs"))
				{
					//审核预警通知
					if(business.getBusiStatus() == 50)
					{
						String customerName = business.getCustomerName();
						OtherMessageApp otherMessageApp_ = new OtherMessageApp();
						otherMessageApp_.setModeId(ModeIDType.TC.getCode());
						otherMessageApp_.setBusiId(business.getId());
						otherMessageApp_.setDataid(fkAuditList.getId());
						otherMessageApp_.setTypeMsg("01");
						otherMessageApp_.setTypeMsgEvent(NewsType.TZ05.getCode());
						otherMessageApp_.setNotificationBar(customerName + "的"+pName+"审核成功");
						otherMessageApp_.setTitle(customerName + "的"+pName+"审核成功");
						otherMessageApp_.setContent("通知：" + customerName + "的"+pName+"审核成功，审核结果：正常");
						Date now = new Date();
						otherMessageApp_.setTimeCreate(now);
						otherMessageApp_.setTimeSend(now);
						otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
						String shortMessage_ = "客户" + customerName +"的"+pName+"审核成功，请登录系统查看详情！";
						serviceHelper.saveMsg(otherMessageApp_, business.getSalesmanId(), customerName, shortMessage_, currentUser, logger);
						//审核预警通知
						continue;
					}
				}
				else if(modeId.equals("M_fkzjsh"))
				{
					//审核预警通知
					if(business.getBusiStatus() == 110)
					{
						String customerName = business.getCustomerName();
						OtherMessageApp otherMessageApp_ = new OtherMessageApp();
						otherMessageApp_.setModeId(ModeIDType.TC.getCode());
						otherMessageApp_.setBusiId(business.getId());
						otherMessageApp_.setDataid(fkAuditList.getId());
						otherMessageApp_.setTypeMsg("01");
						otherMessageApp_.setTypeMsgEvent(NewsType.TZ05.getCode());
						otherMessageApp_.setNotificationBar(customerName + "的"+pName+"审核成功");
						otherMessageApp_.setTitle(customerName + "的"+pName+"审核成功");
						otherMessageApp_.setContent("通知：" + customerName + "的"+pName+"审核成功，审核结果：正常");
						Date now = new Date();
						otherMessageApp_.setTimeCreate(now);
						otherMessageApp_.setTimeSend(now);
						otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
						String shortMessage_ = "客户" + customerName +"的"+pName+"审核成功，请登录系统查看详情！";
						serviceHelper.saveMsg(otherMessageApp_, business.getSalesmanId(), customerName, shortMessage_, currentUser, logger);
						//审核预警通知
						continue;
					}
				}
			}
		}
	}
	
	//通融审核
	private void tongRongShenPi(AbstractSysUser currentUser,FkAuditList fkAuditList,YwBusiness ywBusiness,OtherAuditInfo otherAuditInfo,String modeId,String event)
	{
		//业务信息主键
		String busiId = ywBusiness.getId();
		
		YwBusiness business = new YwBusiness();
		
		//初审
		business.setId(busiId);
		business.setBusiStatus(9010);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_csdcs",busiId,currentUser);
			return;
		}
		//初审
		business = new YwBusiness();
		business.setId(busiId);
		business.setBusiStatus(9020);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_csdzs",busiId,currentUser);
			return;
		}
		//资审一审
		business = new YwBusiness();
		business.setId(busiId);
		business.setBusiStatus(9030);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_zsys",busiId,currentUser);
			return;
		}
		
		//资审二审
		business = new YwBusiness();
		business.setId(busiId);
		business.setBusiStatus(9040);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_zses",busiId,currentUser);
			return;
		}
		
		//电审一审
		business = new YwBusiness();
		business.setId(busiId);
		business.setPhoneStatus(50);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_dscs",busiId,currentUser);
			return;
		}
		
		//电审二审
		business = new YwBusiness();
		business.setId(busiId);
		business.setPhoneStatus(60);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_dsfs",busiId,currentUser);
			return;
		}
		
		//风控经理审核
		business = new YwBusiness();
		business.setId(busiId);
		business.setPhoneStatus(9050);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_fkjlsh",busiId,currentUser);
			return;
		}
		
		//风控总监
		business = new YwBusiness();
		business.setId(busiId);
		business.setPhoneStatus(9060);
		business = ywBusinessMapper.selectRefined(business);
		if(null != business && !("").equals(business))
		{
			insertMTrshData("M_fkzjsh",busiId,currentUser);
			return;
		}
	}
	
	//添加审核的数据
	private void insertMTrshData(String m,String busiId,AbstractSysUser currentUser)
	{
		FkAuditList fkAuditList = new FkAuditList();
		fkAuditList.setBusiId(busiId);
		fkAuditList.setModeId(m);
		fkAuditList.setDpStatus(1);
		fkAuditList.setStatusList(1);
		fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
		
		if(null != fkAuditList && !("").equals(fkAuditList))
		{
			return;
		}
		
		fkAuditList = new FkAuditList();
		fkAuditList.setBusiId(busiId);
		fkAuditList.setModeId(m);
		fkAuditList.setDpStatus(1);
		fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
		if(null == fkAuditList || ("").equals(fkAuditList))
		{
			return;
		}
		
		String userId = currentUser.getId();
		String creatorName = currentUser.getName();
		fkAuditList.initInsertData(userId, creatorName);
		fkAuditList.setStatusList(1);
		fkAuditList.setOperatorId("");
		fkAuditList.setOperatorName("");
		fkAuditList.setAuditDetail("");
		fkAuditList.setAuditPostil("");
		int insertCount = fkAuditListMapper.insert(fkAuditList);
		if(insertCount < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
	}
	
	
	//生成欠资料过审
	private void shengchengZlbqsh(JsonObject object,AbstractSysUser currentUser,FkAuditList fkAuditList)
	{
		//下个模块
		JsonArray  addArray = object.get("additional").getAsJsonArray();
		if(null == addArray || ("").equals(addArray))
		{
			return;
		}
		for(int i=0;i<addArray.size();i++)
		{
			JsonObject objs = addArray.get(i).getAsJsonObject();
			
			//事件
			String addEvent = objs.get("addEvent").getAsString();
			
			if(!addEvent.equals("buildModeID"))
			{
				continue;
			}
			
			//登录信息
			String userId = currentUser.getId();
			String creatorName = currentUser.getName();
			
			//插入的模块
			String modeId = objs.get("modeId").getAsString();
			
			//业务信息编号
			String busiId = fkAuditList.getBusiId();
			//绿色通道
			String channelType = objs.get("channelType").getAsString();
			
			if(null != channelType && !("").equals(channelType))
			{
				String channel = fkAuditList.getChannelType();
				if(!channel.equals(channelType))
				{
					continue;
				}
				
				continue;
			}
			
			FkAuditList auditList = new FkAuditList();
			auditList.setBusiId(busiId);
			auditList.setStatusList(1);
			auditList.setModeId(modeId);
			auditList = fkAuditListMapper.selectRefined(auditList);
			
			if(null != auditList && !("").equals(auditList))
			{
				continue;
			}
			
			fkAuditList.initInsertData(userId, creatorName);
			fkAuditList.setModeId(modeId);
			fkAuditList.setStatusList(1);
			fkAuditList.setOperatorId("");
			fkAuditList.setOperatorName("");
			fkAuditList.setAuditDetail("");
			fkAuditList.setAuditPostil("");
			int inserCount = fkAuditListMapper.insert(fkAuditList);
			if(inserCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
			
			break;
		}
	}
	
	//额外事件  资审二审 电审二审
	private void dianShenZiShenevent(JsonObject object,AbstractSysUser currentUser,YwBusiness ywBusiness,FkAuditList fkAuditList)
	{
		//下个模块
		JsonArray  addArray = object.get("additional").getAsJsonArray();
		if(null == addArray || ("").equals(addArray))
		{
			return;
		}
		
		for(int i=0;i<addArray.size();i++)
		{
			JsonObject objs = addArray.get(i).getAsJsonObject();
			
			//事件
			String addEvent = objs.get("addEvent").getAsString();
			
			if(!addEvent.equals("ifdSzS"))
			{
				continue;
			}
			
			//业务信息编号
			String busiId = ywBusiness.getId();
			
			int busiStatus = objs.get("busiStatus").getAsInt();
			int phoneStatus = objs.get("phoneStatus").getAsInt();
			
			String oneModeId = objs.get("oneModeId").getAsString();
			
			FkAuditList auditList = new FkAuditList();
			auditList.setBusiId(busiId);
			auditList.setModeId(oneModeId);
			auditList.setStatusList(2);
			auditList = fkAuditListMapper.selectRefined(auditList);
			
			if(null == auditList || ("").equals(auditList))
			{
				continue;
			}
			
			//查询业务信息表
			ywBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
			
			//电审二审  资审二审
			//去掉按揭日表表的额外状态值
			if(ywBusiness.getBusiStatus() >= busiStatus && ywBusiness.getPhoneStatus() == phoneStatus)
			{
				//乱七八糟的     根本就瞎改
				FkAuditList fkjl = new FkAuditList();
				fkjl.setBusiId(busiId);
				fkjl.setModeId("M_fkzjsh");
				fkjl.setDpStatus(1);
				fkjl = fkAuditListMapper.selectRefined(fkAuditList);
				
				if(null != fkjl)
				{
					continue;
				}
				
				String modeId = objs.get("modeId").getAsString();
				
				//登录信息
				String userId = currentUser.getId();
				String creatorName = currentUser.getName();

				//执行添加
				fkAuditList = new FkAuditList();
				fkAuditList.setBusiId(busiId);
				fkAuditList.setModeId(modeId);
				fkAuditList.setStatusList(1);
				fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
				if(null != fkAuditList || ("").equals(fkAuditList))
				{
					continue;
				}
				
				auditList.setStatusList(1);
				auditList.setSource("电审二审");
				auditList.setAssigningTaskType(0);
				auditList.initInsertData(userId, creatorName);
				auditList.setModeId(modeId);
				auditList.setOperatorId("");
				auditList.setOperatorName("");
				auditList.setAuditDetail("");
				auditList.setAuditPostil("");
				int inserCount = fkAuditListMapper.insert(auditList);
				if(inserCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				else if(inserCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
				}
				
				ywBusiness.setBusiStatus(90);
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
				}
			}
		}
	}
	
	//自动审核数据
	private void zidongShenData(AbstractSysUser currentUser,JsonObject object,FkAuditList fkAuditList,YwBusiness ywBusiness)
	{
		//自动审核开关
		String witch = object.get("switch").getAsString();
		//模块编号
		String mode_Id = object.get("modeId").getAsString();
		
		if(witch.equals("open"))
		{
			//业务信息表主键
			String busiId = ywBusiness.getId();
			
			String sqlXmls = "select t.id from fk_audit_list t where t.busi_id = '"+busiId+"' and t.status_list = 1 and t.mode_id = '"+mode_Id+"' and t.dp_status = 1 and t.status_list = 1";
			List<Map<String, String>> list = publicDao.queryWhereSql(sqlXmls);
			if(null == list || 0 == list.size())
			{
				return;
			}
			
			//自动审核条件
			JsonArray  ofArray = object.get("zdshList").getAsJsonArray();
			
			if(null != ofArray && 0 != ofArray.size())
			{
				for(int r=0;r<ofArray.size();r++)
				{
					JsonObject zobjs = ofArray.get(r).getAsJsonObject();
					
					//获取配置的值
					String v_money = zobjs.get("money").getAsString();
					String v_channelType = zobjs.get("channelType").getAsString();
					String v_greenType = zobjs.get("greenType").getAsString();
					String v_IsPhoneAudit = zobjs.get("IsPhoneAudit").getAsString();
					
					//经销神标识
					boolean b = false;
					
					JsonArray  levelaArray = zobjs.get("level").getAsJsonArray();
					
					if(null == levelaArray || 0 == levelaArray.size())
					{
						b = true;
					}
					
					if(null != levelaArray && 0 != levelaArray.size())
					{
						//查询业务信息表数据
						YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
						
						if(null != business && !("").equals(business))
						{
							//查询经销商的数据
							DpBaseDealerInfo dpBaseDealerInfo = dpBaseDealerInfoMapper.selectByPrimaryKey(business.getDealerId());
							
							if(null != dpBaseDealerInfo && !("").equals(dpBaseDealerInfo))
							{
								for(int le=0;le<levelaArray.size();le++)
								 {
									 JsonObject os = levelaArray.get(le).getAsJsonObject();
									 
									 String levelName = os.get("levelName").getAsString();
									 
									 if(levelName.equals(dpBaseDealerInfo.getDealerLevel()))
									 {
										   b = true;
										   break;
									 }
								 }
							}
						}
					}
					
					//绿色通道
					if(null != v_greenType && !("").equals(v_greenType))
					{
						String channel_type = fkAuditList.getChannelType();
						
						if(channel_type.equals(v_greenType))
						{
							insertFkAuditList(currentUser,fkAuditList,object);
							continue;
						}
					}
					
					//金额判断  和 经销商等级
					if(null != v_money && !("").equals(v_money))
					{
						//配置金额
						double money = Double.valueOf(v_money);
						
						String autoAudit = zobjs.get("autoAudit").getAsString();
						
						//不同的审核有不同的金额
						if(null != autoAudit && !("").equals(autoAudit))
						{
							if(autoAudit.equals("AutoAudit_Supervisor_info"))
							{
								money = Double.valueOf(SysParamsType.AUTOAUDIT_SUPERVISOR_INFO.getDefaultValue().toString());
								String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_SUPERVISOR_INFO.getCode());
								if(StringUtils.isNotBlank(paramValue)) 
								{
									money = Double.parseDouble(paramValue);
								}
							}
							else if(autoAudit.equals("AutoAudit_PhoneOne"))
							{
								money = Double.valueOf(SysParamsType.AUTOAUDIT_PHONEONE.getDefaultValue().toString());
								String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_PHONEONE.getCode());
								if(StringUtils.isNotBlank(paramValue)) 
								{
									money = Double.parseDouble(paramValue);
								}
							}
							else if(autoAudit.equals("AutoAudit_Supervisor_Phone"))
							{
								money = Double.valueOf(SysParamsType.AUTOAUDIT_SUPERVISOR_PHONE.getDefaultValue().toString());
								String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_SUPERVISOR_PHONE.getCode());
								if(StringUtils.isNotBlank(paramValue)) 
								{
									money = Double.parseDouble(paramValue);
								}
							}
							else if(autoAudit.equals("AutoAudit_Recheck"))
							{
								money = Double.valueOf(SysParamsType.AUTOAUDIT_RECHECK.getDefaultValue().toString());
								String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_RECHECK.getCode());
								if(StringUtils.isNotBlank(paramValue)) 
								{
									money = Double.parseDouble(paramValue);
								}
							}
						}
						
						//审批金额
						double loan_amount = fkAuditList.getLoanAmount();
						
						if(loan_amount <= money && b)
						{
							insertFkAuditList(currentUser,fkAuditList,object);
							continue;
						}
					}
					
					//二证贷  和   业务信息附件表
					if((null != v_IsPhoneAudit && !("").equals(v_IsPhoneAudit)) && (null != v_channelType && !("").equals(v_channelType)))
					{
						if(v_IsPhoneAudit.equals("0"))
						{
							String channel_type = fkAuditList.getChannelType();
							
							YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
							ywBusinessExtras.setBusiId(busiId);
							ywBusinessExtras.setCodeExtras("IsPhoneAudit");
							ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
							
							if(null != ywBusinessExtras && !("").equals(ywBusinessExtras))
							{
								if(channel_type.equals(v_channelType) && ywBusinessExtras.getValueExtras().equals("0"))
								{
									insertFkAuditList(currentUser,fkAuditList,object);
									continue;
								}
							}
						}
					}
					
					//二证贷  和   业务信息附件表
					if((null != v_IsPhoneAudit && !("").equals(v_IsPhoneAudit)))
					{
						if(v_IsPhoneAudit.equals("0"))
						{
							YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
							ywBusinessExtras.setBusiId(busiId);
							ywBusinessExtras.setCodeExtras("IsPhoneAudit");
							ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
							
							if(null != ywBusinessExtras && !("").equals(ywBusinessExtras))
							{
								insertFkAuditList(currentUser,fkAuditList,object);
								continue;
							}
						}
					}
				}
			}
		}
	}
	
	//自动审核 插入待审批数据
	private void insertFkAuditList(AbstractSysUser currentUser,FkAuditList fkAuditList,JsonObject object)
	{
		//登录信息
		String userId = currentUser.getId();
		String creatorName = currentUser.getName();
		
		//业务信息表主键
		String busiId = fkAuditList.getBusiId();
				
		//下个模块
		JsonArray  generateList = object.get("generate").getAsJsonArray();
		if(null == generateList || 0 == generateList.size())
		{
			return;
		}
		
		for(int i=0;i<generateList.size();i++)
		{
			JsonObject objs = generateList.get(i).getAsJsonObject();
			
			//模块编号
			String modeId = objs.get("modeId").getAsString();
			
			FkAuditList fk = new FkAuditList();
			fk.setBusiId(busiId);
			fk.setModeId(modeId);
			fk.setStatusList(1);
			fk = fkAuditListMapper.selectRefined(fk);
			if(null != fk && !("").equals(fk))
			{
				continue;
			}
			
			fkAuditList.initInsertData(userId, creatorName);
			fkAuditList.setModeId(modeId);
			fkAuditList.setOperatorId("");
			fkAuditList.setOperatorName("");
			fkAuditList.setAuditDetail("");
			fkAuditList.setAuditPostil("");
			int inserCount = fkAuditListMapper.insert(fkAuditList);
			if(inserCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
			else if(inserCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
			}
		}
	}
	
	//修改待审批信息表的状态
	private void auditListUpdate(AbstractSysUser currentUser,JsonObject object,FkAuditList fkAuditList,YwBusiness ywBusiness)
	{
		//自动审核开关
		String witch = object.get("switch").getAsString();
		//模块编号
		String mode_Id = object.get("modeId").getAsString();
		
		if(witch.equals("open"))
		{
			//业务信息表主键
			String busiId = ywBusiness.getId();
			
			
			//判断是不是风控经理
			if(mode_Id.equals("M_fkjlsh"))
			{
				YwBusiness bus = ywBusinessMapper.selectByPrimaryKey(busiId);
				if(null != bus && bus.getBusiStatus() != 100)
				{
					return;
				}
			}
			
			//判断 当前的数据已经存在 则不执行
			String sqlXmls = "select t.id from fk_audit_list t where t.busi_id = '"+busiId+"' and t.status_list = 1 and t.mode_id = '"+mode_Id+"' and t.dp_status = 1 and t.status_list = 1";
			List<Map<String, String>> list = publicDao.queryWhereSql(sqlXmls);
			if(null == list || 0 == list.size())
			{
				return;
			}
			
			//自动审核条件
			JsonArray  ofArray = object.get("zdshList").getAsJsonArray();
			
			if(null != ofArray && 0 != ofArray.size())
			{
				for(int r=0;r<ofArray.size();r++)
				{
					JsonObject zobjs = ofArray.get(r).getAsJsonObject();
					
					//获取配置的值
					String v_money = zobjs.get("money").getAsString();
					String v_channelType = zobjs.get("channelType").getAsString();
					String v_greenType = zobjs.get("greenType").getAsString();
					String v_IsPhoneAudit = zobjs.get("IsPhoneAudit").getAsString();
					
					//经销神标识
					boolean b = false;
					
					JsonArray  levelaArray = zobjs.get("level").getAsJsonArray();
					
					if(null == levelaArray || 0 == levelaArray.size())
					{
						b = true;
					}
					
					if(null != levelaArray && 0 != levelaArray.size())
					{
						//查询业务信息表数据
						YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
						
						if(null != business && !("").equals(business))
						{
							//查询经销商的数据
							DpBaseDealerInfo dpBaseDealerInfo = dpBaseDealerInfoMapper.selectByPrimaryKey(business.getDealerId());
							
							if(null != dpBaseDealerInfo && !("").equals(dpBaseDealerInfo))
							{
								for(int le=0;le<levelaArray.size();le++)
								 {
									 JsonObject os = levelaArray.get(le).getAsJsonObject();
									 
									 String levelName = os.get("levelName").getAsString();
									 
									 if(levelName.equals(dpBaseDealerInfo.getDealerLevel()))
									 {
										   b = true;
										   break;
									 }
								 }
							}
						}
					}
					
					//绿色通道
					if(null != v_greenType && !("").equals(v_greenType))
					{
						String channel_type = fkAuditList.getChannelType();
						
						if(channel_type.equals(v_greenType))
						{
							auditListUpdateStatus2(mode_Id,busiId,currentUser,object);
							continue;
						}
					}
					
					//金额判断  和 经销商等级
					if(null != v_money && !("").equals(v_money))
					{
						//配置金额
						double money = Double.valueOf(v_money);
						
						String autoAudit = zobjs.get("autoAudit").getAsString();
						
						if(autoAudit.equals("AutoAudit_Supervisor_info"))
						{
							money = Double.valueOf(SysParamsType.AUTOAUDIT_SUPERVISOR_INFO.getDefaultValue().toString());
							String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_SUPERVISOR_INFO.getCode());
							if(StringUtils.isNotBlank(paramValue)) 
							{
								money = Double.parseDouble(paramValue);
							}
						}
						else if(autoAudit.equals("AutoAudit_PhoneOne"))
						{
							money = Double.valueOf(SysParamsType.AUTOAUDIT_PHONEONE.getDefaultValue().toString());
							String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_PHONEONE.getCode());
							if(StringUtils.isNotBlank(paramValue)) 
							{
								money = Double.parseDouble(paramValue);
							}
						}
						else if(autoAudit.equals("AutoAudit_Supervisor_Phone"))
						{
							money = Double.valueOf(SysParamsType.AUTOAUDIT_SUPERVISOR_PHONE.getDefaultValue().toString());
							String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_SUPERVISOR_PHONE.getCode());
							if(StringUtils.isNotBlank(paramValue)) 
							{
								money = Double.parseDouble(paramValue);
							}
						}
						else if(autoAudit.equals("AutoAudit_Recheck"))
						{
							money = Double.valueOf(SysParamsType.AUTOAUDIT_RECHECK.getDefaultValue().toString());
							String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_RECHECK.getCode());
							if(StringUtils.isNotBlank(paramValue)) 
							{
								money = Double.parseDouble(paramValue);
							}
						}
						
						//审批金额
						double loan_amount = fkAuditList.getLoanAmount();
						
						if(loan_amount <= money && b)
						{
							auditListUpdateStatus2(mode_Id,busiId,currentUser,object);
							continue;
						}
					}
					
					//二证贷  和   业务信息附件表
					if((null != v_IsPhoneAudit && !("").equals(v_IsPhoneAudit)) && (null != v_channelType && !("").equals(v_channelType)))
					{
						if(v_IsPhoneAudit.equals("0"))
						{
							String channel_type = fkAuditList.getChannelType();
							
							YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
							ywBusinessExtras.setBusiId(busiId);
							ywBusinessExtras.setCodeExtras("IsPhoneAudit");
							ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
							
							if(null != ywBusinessExtras && !("").equals(ywBusinessExtras))
							{
								if(channel_type.equals(v_channelType) && ywBusinessExtras.getValueExtras().equals("0"))
								{
									auditListUpdateStatus2(mode_Id,busiId,currentUser,object);
									continue;
								}
							}
						}
					}
					
					//二证贷  和   业务信息附件表
					if((null != v_IsPhoneAudit && !("").equals(v_IsPhoneAudit)))
					{
						if(v_IsPhoneAudit.equals("0"))
						{
							YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
							ywBusinessExtras.setBusiId(busiId);
							ywBusinessExtras.setCodeExtras("IsPhoneAudit");
							ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
							
							if(null != ywBusinessExtras && !("").equals(ywBusinessExtras))
							{
								auditListUpdateStatus2(mode_Id,busiId,currentUser,object);
								continue;
							}
						}
					}
				}
			}
		}
	}
	
	//修改待审批列表状态
	private void auditListUpdateStatus2(String mode_Id,String busiId,AbstractSysUser currentUser,JsonObject jsonObject)
	{
		//登录信息
		String userId = currentUser.getId();
		String modifierName = currentUser.getName();
		
		//查询待审批列表数据
		FkAuditList fkAuditList = new FkAuditList();
		fkAuditList.setModeId(mode_Id);
		fkAuditList.setBusiId(busiId);
		fkAuditList.setStatusList(1);
		fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
		if(null == fkAuditList || ("").equals(fkAuditList))
		{
			return;
		}
		
		fkAuditList.setStatusList(2);
		fkAuditList.initUpdateData(userId, modifierName);
		fkAuditList.initUpdateData(userId, modifierName);
		fkAuditList.setTimeAuditFinish(new Date());
		int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList);
		if(updateCount == 0)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
		else if(updateCount > 1)
		{
			throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
		}
		
		//业务信息表
		YwBusiness ywBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
		if(null == ywBusiness || ("").equals(ywBusiness))
		{
			return;
		}
		
		//修改状态
		ywBusinessUpdate(currentUser,jsonObject,ywBusiness,fkAuditList);
		
		//插入记录表
		insertOtherAuditInfo(currentUser,jsonObject,ywBusiness,fkAuditList);
	}
	
	//修改业务信息表状态
	private void ywBusinessUpdate(AbstractSysUser currentUser,JsonObject jsonObject,YwBusiness ywBusiness,FkAuditList fkAuditList)
	{
		//登录信息
		String userId = currentUser.getId();
		String modifierName = currentUser.getName();
		
		//获取要执行事件数组
		JsonArray  eventjArray = jsonObject.get("event").getAsJsonArray();
		if(null == eventjArray || 0 == eventjArray.size())
		{
			return;
		}
		
		for(int i=0;i<eventjArray.size();i++)
		{
			JsonObject object = eventjArray.get(i).getAsJsonObject();
			
			//获取当前的事件
			String event = object.get("event").getAsString();
			
			if(!event.equals("pass"))
			{
				continue;
			}
			
			//终审则修改电审状态
			if(fkAuditList.getModeId().equals("M_csdzs"))
			{
				ywBusiness.setPhoneStatus(20);
			}
			
			//字段改变值
			int fieldFlag = object.get("fieldFlag").getAsInt();
			
			//业务信息表状态修改 
			if(fieldFlag == 0)
			{
				//业务信息表的状态值
				int busiStatus = object.get("busiStatus").getAsInt();
				
				//修改业务信息表的状态值
				ywBusiness.setBusiStatus(busiStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
				}
				continue;
			}
			
			//修改业务信息表  PhoneStatus 值
			if(fieldFlag == 3)
			{
				//业务信息表的状态值
				int phoneStatus = object.get("phoneStatus").getAsInt();
				
				//修改业务信息表的状态值
				ywBusiness.setPhoneStatus(phoneStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
				}
				continue;
			}
			
			//修改业务信息表 tongrongStatus 值
			if(fieldFlag == 4)
			{
				//业务信息表的状态值
				int tongrongStatus = object.get("tongrongStatus").getAsInt();
				
				//修改业务信息表的状态值
				ywBusiness.setTongrongStatus(tongrongStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
				}
				continue;
			}
			
			//修改业务信息表 channelStatus 值
			if(fieldFlag == 5)
			{
				//业务信息表的状态值
				int channelStatus = object.get("channelStatus").getAsInt();
				
				//修改业务信息表的状态值
				ywBusiness.setChannelStatus(channelStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
				}
				continue;
			}
		}
	}
	
	//插入审核记录表
	private void insertOtherAuditInfo(AbstractSysUser currentUser,JsonObject jsonObject,YwBusiness ywBusiness,FkAuditList fkAuditList)
	{
		//登录信息
		String userId = currentUser.getId();
		String creatorName = currentUser.getName();
		
		//业务信息表主键
		String busiId = ywBusiness.getId();
				
		//上级的来源名称
		String pName = jsonObject.get("pName").getAsString();
		//上级模块编号
		String pModeId = jsonObject.get("modeId").getAsString();
		//必须字段
		String replaceId = fkAuditList.getId();
		
		
		//查询上级审核的批注信息
		OtherAuditInfo info = new OtherAuditInfo();
		info.setModeId(mod);
		info.setBusiId(busiId);
		info.setDpStatus(1);
		info = otherAuditInfoMapper.selectRefined(info);
		
		//获取要执行事件数组
		JsonArray  eventjArray = jsonObject.get("event").getAsJsonArray();
		if(null == eventjArray || 0 == eventjArray.size())
		{
			return;
		}
		
		for(int i=0;i<eventjArray.size();i++)
		{
			JsonObject object = eventjArray.get(i).getAsJsonObject();
			
			//获取当前的事件
			String event = object.get("event").getAsString();
			
			if(!event.equals("pass"))
			{
				continue;
			}
			
			//字段改变值
			int fieldFlag = object.get("fieldFlag").getAsInt();
			//待审批列表的状态值
			int statusList = object.get("statusList").getAsInt();
			
			//插入记录表
			OtherAuditInfo otherAuditInfo = new OtherAuditInfo();
			otherAuditInfo.initInsertData(userId, creatorName);
			otherAuditInfo.setAuditName(pName);
			otherAuditInfo.setOrgName("自动审核");
			otherAuditInfo.setBusiId(busiId);
			otherAuditInfo.setModeId(pModeId);
			otherAuditInfo.setDataId(replaceId);
			otherAuditInfo.setCreator("00000000000000000000000000000000");
			otherAuditInfo.setCreatorName("自动审核");
			
			if(null != info)
			{
				otherAuditInfo.setAuditDetail(info.getAuditDetail());
				otherAuditInfo.setAuditPostil(info.getAuditPostil());
			}
			
			otherAuditInfo.setRemarks(pName + event);
			
			//业务信息表状态修改 
			if(fieldFlag == 0)
			{
				//业务信息表的状态值
				int busiStatus = object.get("busiStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				
				//插入审批记录表的数据
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(busiStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				continue;
			}
			
			//修改业务信息表  PhoneStatus 值
			if(fieldFlag == 3)
			{
				//业务信息表的状态值
				int phoneStatus = object.get("phoneStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(phoneStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				continue;
			}
			
			//修改业务信息表 tongrongStatus 值
			if(fieldFlag == 4)
			{
				//业务信息表的状态值
				int tongrongStatus = object.get("tongrongStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(tongrongStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				continue;
			}
			
			//修改业务信息表 channelStatus 值
			if(fieldFlag == 5)
			{
				//业务信息表的状态值
				int channelStatus = object.get("channelStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(channelStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				continue;
			}
		}
	}
	
	//风控审核  退回修改  editback
	private void editback(AbstractSysUser currentUser,FkAuditList fkAuditList,YwBusiness ywBusiness,OtherAuditInfo otherAuditInfo,JsonObject jsonObject,String tuModeId)
	{
		//登录信息
		String userId = currentUser.getId();
		String modifierName = currentUser.getName();
		String creatorName = currentUser.getName();
		
		//业务主键
		String busiId = ywBusiness.getId();
		//必须字段
		String replaceId = otherAuditInfo.getDataId();
		//上级的来源名称
		String pName = jsonObject.get("pName").getAsString();
		
		//上级模块编号
		String pModeId = jsonObject.get("modeId").getAsString();
		
		//获取要执行事件数组
		JsonArray  eventjArray = jsonObject.get("event").getAsJsonArray();
		
		if(null == eventjArray || 0 == eventjArray.size())
		{
			return;
		}
		
		for(int i=0;i<eventjArray.size();i++)
		{
			JsonObject object = eventjArray.get(i).getAsJsonObject();
			
			//获取当前的事件
			String event = object.get("event").getAsString();
			
			if(!event.equals("editBack"))
			{
				continue;
			}
			
			//字段改变值
			int fieldFlag = object.get("fieldFlag").getAsInt();
			//待审批列表的状态值
			int statusList = object.get("statusList").getAsInt();
			
			//业务信息表状态修改 
			if(fieldFlag == 0)
			{
				//业务信息表的状态值
				int busiStatus = object.get("busiStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(busiStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				if(null == otherAuditInfo.getRemarks() || ("").equals(otherAuditInfo.getRemarks()))
				{
					otherAuditInfo.setRemarks(pName + event);
				}
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setBusiStatus(busiStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//退回插入待审批列表
			FkAuditList tAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null != tAuditList && !("").equals(tAuditList))
			{
				tAuditList.initDeleteData(userId, modifierName);
				tAuditList.setId(UUIDFactory.getUUID());
				tAuditList.setStatusList(1);
				tAuditList.setDpStatus(1);
				tAuditList.setModeId(tuModeId);
				tAuditList.setOperatorId("");
				tAuditList.setOperatorName("");
				tAuditList.setAuditDetail("");
				tAuditList.setAuditPostil("");
				fkAuditListMapper.insert(tAuditList);
			}
			
			//修改审批记录表的值
			FkAuditList fkAuditList2 = new FkAuditList();
			fkAuditList2.setId(replaceId);
			fkAuditList2.setStatusList(statusList);
			fkAuditList2.initUpdateData(userId, modifierName);
			fkAuditList2.setTimeAuditFinish(new Date());
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList2);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
			}
			
			//派单类型
//			int assigningTaskType = 0;
			
			//如果是电审二审 资审一审则不执行  作为一个事件来处理
			if(pModeId.equals("M_zses") || pModeId.equals("M_dsfs"))
			{
				continue;
			}
			
			//插入待审批列表值  数组节点
//			JsonArray  auditArray = jsonObject.get("generate").getAsJsonArray();
//			
//			if(null == auditArray || 0 == auditArray.size())
//			{
//				continue;
//			}
//			
//			//添加这个模块的数据值
//			for(int j=0;j<auditArray.size();j++)
//			{
//				JsonObject objs = auditArray.get(j).getAsJsonObject();
//				
//				String modeId = objs.get("modeId").getAsString();
//				
//				//查询  如果当期这条因为信息 未审核的数据已经插入了  就不要插入了
//				FkAuditList fk = new FkAuditList();
//				fk.setBusiId(fkAuditList.getBusiId());
//				fk.setModeId(modeId);
//				fk.setStatusList(1);
//				FkAuditList auditList = fkAuditListMapper.selectRefined(fk);
//				if(null != auditList && !("").equals(auditList))
//				{
//					continue;
//				}
//				
//				//插入待审批列表的值
//				fkAuditList.setModeId(modeId);
//				fkAuditList.setSource(pName);
//				fkAuditList.setAssigningTaskType(assigningTaskType);
//				fkAuditList.initInsertData(userId, creatorName);
//				fkAuditList.setOperatorId("");
//				fkAuditList.setOperatorName("");
//				fkAuditList.setAuditDetail("");
//				fkAuditList.setAuditPostil("");
//				int inserCount = fkAuditListMapper.insert(fkAuditList);
//				if(inserCount < 1)
//				{
//					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
//				} 
//			}
			break;
		}
	}
	
	//风控审核  审核不过 fail
	private void fail(AbstractSysUser currentUser,FkAuditList fkAuditList,YwBusiness ywBusiness,OtherAuditInfo otherAuditInfo,JsonObject jsonObject)
	{
		String userId = currentUser.getId();
		String modifierName = currentUser.getName();
		String creatorName = currentUser.getName();
		
		//必须字段
		String replaceId = otherAuditInfo.getDataId();
		
		//业务信息表主键
		String busiId = ywBusiness.getId();
		
		//上级的来源名称
		String pName = jsonObject.get("pName").getAsString();
		
		//获取要执行事件数组
		JsonArray  eventjArray = jsonObject.get("event").getAsJsonArray();
		
		if(null == eventjArray || 0 == eventjArray.size())
		{
			return;
		}
		
		for(int i=0;i<eventjArray.size();i++)
		{
			JsonObject object = eventjArray.get(i).getAsJsonObject();
			
			//获取当前的事件
			String event = object.get("event").getAsString();
			
			if(!event.equals("fail"))
			{
				continue;
			}
			
			//字段改变值
			int fieldFlag = object.get("fieldFlag").getAsInt();
			//待审批列表的状态值
			int statusList = object.get("statusList").getAsInt();
			
			//业务信息表状态修改 
			if(fieldFlag == 0)
			{
				//业务信息表的状态值
				int busiStatus = object.get("busiStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(busiStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setBusiStatus(busiStatus); 
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			
			//修改业务信息表  PhoneStatus 值
			if(fieldFlag == 3)
			{
				//业务信息表的状态值
				int phoneStatus = object.get("phoneStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(phoneStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setPhoneStatus(phoneStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改业务信息表 tongrongStatus 值
			if(fieldFlag == 4)
			{
				//业务信息表的状态值
				int tongrongStatus = object.get("tongrongStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(tongrongStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setTongrongStatus(tongrongStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改业务信息表 channelStatus 值
			if(fieldFlag == 5)
			{
				//业务信息表的状态值
				int channelStatus = object.get("channelStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(channelStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setChannelStatus(channelStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改审批记录表的值
			FkAuditList fkAuditList2 = new FkAuditList();
			fkAuditList2.setId(replaceId);
			fkAuditList2.setStatusList(statusList);
			fkAuditList2.initUpdateData(userId, modifierName);
			fkAuditList2.setTimeAuditFinish(new Date());
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList2);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
			}
			break;
		}
	}
	
	
	//风控审核  过审执行  Pass
	private void pass(AbstractSysUser currentUser,FkAuditList fkAuditList,YwBusiness ywBusiness,OtherAuditInfo otherAuditInfo,JsonObject jsonObject)
	{
		String userId = currentUser.getId();
		String modifierName = currentUser.getName();
		String creatorName = currentUser.getName();
		
		//业务信息表主键
		String busiId = ywBusiness.getId();
		//必须字段
		String replaceId = otherAuditInfo.getDataId();
		//上级的来源名称
		String pName = jsonObject.get("pName").getAsString();
		//上级模块编号
		String pModeId = jsonObject.get("modeId").getAsString();
		
		//获取要执行事件数组
		JsonArray  eventjArray = jsonObject.get("event").getAsJsonArray();
		
		if(null == eventjArray || 0 == eventjArray.size())
		{
			return;
		}
		
		//如果是终生  则修改电审状态
		if(pModeId.equals("M_csdzs"))
		{
			ywBusiness.setPhoneStatus(20);
		}
		
		for(int i=0;i<eventjArray.size();i++)
		{
			JsonObject object = eventjArray.get(i).getAsJsonObject();
			
			//获取当前的事件
			String event = object.get("event").getAsString();
			
			if(!event.equals("pass"))
			{
				continue;
			}
			
			//字段改变值
			int fieldFlag = object.get("fieldFlag").getAsInt();
			//待审批列表的状态值
			int statusList = object.get("statusList").getAsInt();
			
			//业务信息表状态修改 
			if(fieldFlag == 0)
			{
				//业务信息表的状态值
				int busiStatus = object.get("busiStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(busiStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setBusiStatus(busiStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			if(fieldFlag == 6)
			{
				//业务信息表的状态值
				int addedStatus1 = object.get("addedStatus1").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(addedStatus1);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setAddedStatus1(addedStatus1);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改业务信息表  PhoneStatus 值
			if(fieldFlag == 3)
			{
				//业务信息表的状态值
				int phoneStatus = object.get("phoneStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(phoneStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setPhoneStatus(phoneStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改业务信息表 tongrongStatus 值
			if(fieldFlag == 4)
			{
				//业务信息表的状态值
				int tongrongStatus = object.get("tongrongStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(tongrongStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setTongrongStatus(tongrongStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改业务信息表 channelStatus 值
			if(fieldFlag == 5)
			{
				//业务信息表的状态值
				int channelStatus = object.get("channelStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setBusiId(busiId);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(channelStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setChannelStatus(channelStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//欠资料过审 LessInformationStatus
			if(fieldFlag == 2)
			{
				//业务信息表的状态值
				int busiStatus = object.get("busiStatus").getAsInt();
				//欠资料的状态
				int lessInformationStatus = object.get("LessInformationStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(busiStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				//ywBusiness.setBusiStatus(busiStatus);
				ywBusiness.setLessInformationStatus(lessInformationStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改审批记录表的值
			FkAuditList fkAuditList2 = new FkAuditList();
			fkAuditList2.setId(replaceId);
			fkAuditList2.setStatusList(statusList);
			fkAuditList2.initUpdateData(userId, modifierName);
			fkAuditList2.setTimeAuditFinish(new Date());
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList2);
			if(updateCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
			
			//派单类型
			int assigningTaskType = object.get("assigning_task_type").getAsInt();
			
			//如果是电审二审 资审一审则不执行  作为一个事件来处理
			if(pModeId.equals("M_zses") || pModeId.equals("M_dsfs"))
			{
				continue;
			}
			
			//插入待审批列表值  数组节点
			JsonArray  auditArray = jsonObject.get("generate").getAsJsonArray();
			
			if(null == auditArray || 0 == auditArray.size())
			{
				continue;
			}
			
			for(int j=0;j<auditArray.size();j++)
			{
				JsonObject objs = auditArray.get(j).getAsJsonObject();
				String modeId = objs.get("modeId").getAsString();
				
				//查询  如果当期这条因为信息 未审核的数据已经插入了  就不要插入了
				FkAuditList fk = new FkAuditList();
				fk.setBusiId(fkAuditList.getBusiId());
				fk.setModeId(modeId);
				fk.setStatusList(1);
				FkAuditList auditList = fkAuditListMapper.selectRefined(fk);
				if(null != auditList && !("").equals(auditList))
				{
					continue;
				}
				
				//插入待审批列表的值
				fkAuditList.setModeId(modeId);
				fkAuditList.setSource(pName);
				fkAuditList.setAssigningTaskType(assigningTaskType);
				fkAuditList.initInsertData(userId, creatorName);
				fkAuditList.setOperatorId("");
				fkAuditList.setOperatorName("");
				fkAuditList.setAuditDetail("");
				fkAuditList.setAuditPostil("");
				int inserCount = fkAuditListMapper.insert(fkAuditList);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			
			//额外事件
			JsonArray  addArray = jsonObject.get("additional").getAsJsonArray();
			if(null != addArray && 0 != addArray.size())
			{
				for(int x=0;x<addArray.size();x++)
				{
					JsonObject objs = addArray.get(x).getAsJsonObject();
					
					@SuppressWarnings("unused")
					String addEvent = objs.get("addEvent").getAsString();
					
//					if(addEvent.equals("fkshtytz"))
//					{
//						//审核预警通知
//						String customerName = ywBusiness.getCustomerName();
//						OtherMessageApp otherMessageApp_ = new OtherMessageApp();
//						otherMessageApp_.setModeId(ModeIDType.TC.getCode());
//						otherMessageApp_.setBusiId(ywBusiness.getId());
//						otherMessageApp_.setDataid(fkAuditList.getId());
//						otherMessageApp_.setTypeMsg("01");
//						otherMessageApp_.setTypeMsgEvent(NewsType.TZ05.getCode());
//						otherMessageApp_.setNotificationBar(customerName + "的"+pName+"审核成功");
//						otherMessageApp_.setTitle(customerName + "的"+pName+"审核成功");
//						otherMessageApp_.setContent("通知：" + customerName + "的"+pName+"审核成功，审核结果：正常");
//						Date now = new Date();
//						otherMessageApp_.setTimeCreate(now);
//						otherMessageApp_.setTimeSend(now);
//						otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
//						String shortMessage_ = "客户" + customerName +"的"+pName+"审核成功，请登录系统查看详情！";
//						serviceHelper.saveMsg(otherMessageApp_, ywBusiness.getCustomerId(), customerName, shortMessage_, currentUser, logger);
//						//审核预警通知
//					}
				}
			}
			break;
		}
	}
	
	//风控审核  欠资料过审  Lesspass
	private void Lesspass(AbstractSysUser currentUser,FkAuditList fkAuditList,YwBusiness ywBusiness,OtherAuditInfo otherAuditInfo,JsonObject jsonObject)
	{
		String userId = currentUser.getId();
		String modifierName = currentUser.getName();
		String creatorName = currentUser.getName();
		
		//必须字段
		String replaceId = otherAuditInfo.getDataId();
		//上级的来源名称
		String pName = jsonObject.get("pName").getAsString();
		//上级模块编号
		String pModeId = jsonObject.get("modeId").getAsString();
		
		//获取要执行事件数组
		JsonArray  eventjArray = jsonObject.get("event").getAsJsonArray();
		
		if(null == eventjArray || 0 == eventjArray.size())
		{
			return;
		}
		
		for(int i=0;i<eventjArray.size();i++)
		{
			JsonObject object = eventjArray.get(i).getAsJsonObject();
			
			//获取当前的事件
			String event = object.get("event").getAsString();
			
			if(!event.equals("lesspass"))
			{
				continue;
			}
			
			
			//字段改变值
			int fieldFlag = object.get("fieldFlag").getAsInt();
			//待审批列表的状态值
			int statusList = object.get("statusList").getAsInt();
			
			//欠资料过审
			if(fieldFlag == 2)
			{
				//业务信息表的状态值
				int busiStatus = object.get("busiStatus").getAsInt();
				//欠资料的状态
				int lessInformationStatus = object.get("LessInformationStatus").getAsInt();
				//修改的那个字段
				String fieldName = object.get("fieldName").getAsString();
				//待审批列表修改前的值
				int preAuditStatus = fkAuditList.getStatusList();
				//业务信息表修改之前的状态值
				int preAuditStatusValue = ywBusiness.getBusiStatus();
				
				//插入审批记录表的数据
				otherAuditInfo.initInsertData(userId, creatorName);
				otherAuditInfo.setAuditName(pName);
				otherAuditInfo.setAuditStatusValueType(fieldName);
				otherAuditInfo.setAuditStatusValue(busiStatus);
				otherAuditInfo.setAuditStatus(String.valueOf(statusList));
				otherAuditInfo.setPreAuditStatusType(fieldName);
				otherAuditInfo.setPreAuditStatusValue(preAuditStatusValue);
				otherAuditInfo.setPreAuditStatus(String.valueOf(preAuditStatus));
				otherAuditInfo.setRemarks(pName + event);
				//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
				int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
				
				//修改业务信息表的状态值
				ywBusiness.setBusiStatus(busiStatus);
				ywBusiness.setLessInformationStatus(lessInformationStatus);
				ywBusiness.initUpdateData(userId, modifierName);
				ywBusiness.setTimeAuditFinish(new Date());
				int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//修改审批记录表的值
			FkAuditList fkAuditList2 = new FkAuditList();
			fkAuditList2.setId(replaceId);
			fkAuditList2.setStatusList(statusList);
			fkAuditList2.initUpdateData(userId, modifierName);
			fkAuditList2.setTimeAuditFinish(new Date());
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList2);
			if(updateCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
			} 
			
			//派单类型
			int assigningTaskType = object.get("assigning_task_type").getAsInt();
			
			//如果是电审二审 资审一审则不执行  作为一个事件来处理
			if(pModeId.equals("M_zses") || pModeId.equals("M_dsfs"))
			{
				continue;
			}
			
			//插入待审批列表值  数组节点
			JsonArray  auditArray = jsonObject.get("generate").getAsJsonArray();
			
			if(null == auditArray || 0 == auditArray.size())
			{
				continue;
			}
			
			for(int j=0;j<auditArray.size();j++)
			{
				JsonObject objs = auditArray.get(j).getAsJsonObject();
				
				String modeId = objs.get("modeId").getAsString();
				
				//查询  如果当期这条因为信息 未审核的数据已经插入了  就不要插入了
				FkAuditList fk = new FkAuditList();
				fk.setBusiId(fkAuditList.getBusiId());
				fk.setModeId(modeId);
				fk.setStatusList(1);
				FkAuditList auditList = fkAuditListMapper.selectRefined(fk);
				if(null != auditList && !("").equals(auditList))
				{
					continue;
				}
				
				//插入待审批列表的值
				fkAuditList.setModeId(modeId);
				fkAuditList.setSource(pName);
				fkAuditList.setAssigningTaskType(assigningTaskType);
				fkAuditList.initInsertData(userId, creatorName);
				fkAuditList.setOperatorId("");
				fkAuditList.setOperatorName("");
				fkAuditList.setAuditDetail("");
				fkAuditList.setAuditPostil("");
				int inserCount = fkAuditListMapper.insert(fkAuditList);
				if(inserCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
				} 
			}
			
			//生成欠资料审核数据
			JsonArray  addArray = jsonObject.get("additional").getAsJsonArray();
			
			if(null != addArray && 0 != addArray.size())
			{
				for(int x=0;x<addArray.size();x++)
				{
					JsonObject objs = addArray.get(x).getAsJsonObject();
					
					String addEvent = objs.get("addEvent").getAsString();
					
					if(addEvent.equals("buildModeID"))
					{
						String channelType = objs.get("channelType").getAsString();
						String busiId = fkAuditList.getBusiId();
						
						if(null == channelType || channelType.equals(""))
						{
							String modeId = objs.get("modeId").getAsString();
							
							FkAuditList auditList = new FkAuditList();
							auditList.setBusiId(busiId);
							auditList.setModeId(modeId);
							auditList.setStatusList(1);
							auditList = fkAuditListMapper.selectRefined(auditList);
							
							if(null == auditList || ("").equals(auditList))
							{
								fkAuditList.setModeId(modeId);
								fkAuditList.setSource(pName);
								fkAuditList.setAssigningTaskType(assigningTaskType);
								fkAuditList.initInsertData(userId, creatorName);
								fkAuditList.setOperatorId("");
								fkAuditList.setOperatorName("");
								fkAuditList.setAuditDetail("");
								fkAuditList.setAuditPostil("");
								int inserCount = fkAuditListMapper.insert(fkAuditList);
								if(inserCount < 1)
								{
									throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
								} 
							}
						}
					}
//					else if(addEvent.equals("fkshtytz"))
//					{
//						//审核预警通知
//						String customerName = ywBusiness.getCustomerName();
//						OtherMessageApp otherMessageApp_ = new OtherMessageApp();
//						otherMessageApp_.setModeId(ModeIDType.TC.getCode());
//						otherMessageApp_.setBusiId(ywBusiness.getId());
//						otherMessageApp_.setDataid(fkAuditList.getId());
//						otherMessageApp_.setTypeMsg("01");
//						otherMessageApp_.setTypeMsgEvent(NewsType.TZ11.getCode());
//						otherMessageApp_.setNotificationBar(customerName + "的"+pName+"审核成功");
//						otherMessageApp_.setTitle(customerName + "的"+pName+"审核成功");
//						otherMessageApp_.setContent("通知：" + customerName + "的"+pName+"审核成功，审核结果：正常");
//						Date now = new Date();
//						otherMessageApp_.setTimeCreate(now);
//						otherMessageApp_.setTimeSend(now);
//						otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
//						String shortMessage_ = "客户" + customerName +"的"+pName+"审核成功，请登录系统查看详情！";
//						serviceHelper.saveMsg(otherMessageApp_, ywBusiness.getCustomerId(), customerName, shortMessage_, currentUser, logger);
//						//审核预警通知
//					}
				}
			}
			break;
		}
	}

	/* 
	* @author zhangpp
	* <p>Title: selectByExtZpp</p> 
	* <p>Description: </p> 
	* @param fkAuditListExt
	* @return 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#selectByExtZpp(com.zjdiepu.www.model.fk.ext.FkAuditListExt) 
	* @version V1.0
	*/
	@Override
	public List<FkAuditList> selectByExtZpp(FkAuditListExt fkAuditListExt) {
		
		return fengKongShenHeDao.selectByExtZpp(fkAuditListExt);
	}

	/* 
	* @author zhangpp
	* <p>Title: selectByExtZppCount</p> 
	* <p>Description: </p> 
	* @param fkAuditListExt
	* @return 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#selectByExtZppCount(com.zjdiepu.www.model.fk.ext.FkAuditListExt) 
	* @version V1.0
	*/
	@Override
	public int selectByExtZppCount(FkAuditListExt fkAuditListExt) {
		
		return fengKongShenHeDao.selectByExtZppCount(fkAuditListExt);
	}

	/* 
	* @author zhangpp
	* <p>Title: tuiHuiShenHe</p> 
	* <p>Description: </p> 
	* @param currentUser
	* @param busiId
	* @param modeId 
	* @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#tuiHuiShenHe(com.zjdiepu.www.base.core.AbstractSysUser, java.lang.String, java.lang.String) 
	* @version V1.0
	*/
	@Override
	public void diepuTuiHuiShenHe(AbstractSysUser currentUser, String busiId,String modeId,String audit_detail,String audit_postil) 
	{
		
		
		String userId = currentUser.getId();
		String creatorName = currentUser.getName();
		
		//修改为过户中
		YwBusiness ywBusiness = new YwBusiness();
		ywBusiness.initUpdateData(userId, creatorName);
		ywBusiness.setId(busiId);
		ywBusiness.setBusiStatus(200);
		int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
		if(updateCount < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
		
		//查询待审批数据
		FkAuditList fkAuditList = new FkAuditList();
		fkAuditList.setBusiId(busiId);
		fkAuditList.setDpStatus(1);
		fkAuditList.setStatusList(1);
		fkAuditList.setModeId("M_ghsh");
		fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
		
		if(null == fkAuditList || ("").equals(fkAuditList))
		{
			return;
		}
		
		//业务信息表
		YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
		
		if(null == business || ("").equals(business))
		{
			return;
		}
		
		//修状态退回
		FkAuditList auditList = new FkAuditList();
		auditList.setId(fkAuditList.getId());
		auditList.setStatusList(4);
		updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
		if(updateCount < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
		
		
		//插入审批记录表的数据
		OtherAuditInfo otherAuditInfo = new OtherAuditInfo();
		otherAuditInfo.initInsertData(userId, creatorName);
		otherAuditInfo.setBusiId(busiId);
		otherAuditInfo.setDataId(fkAuditList.getId());
		otherAuditInfo.setModeId("M_ghsh");
		otherAuditInfo.setAuditDetail(audit_detail);
		otherAuditInfo.setAuditPostil(audit_postil);
		otherAuditInfo.setAuditName("过户审核");
		otherAuditInfo.setAuditStatusValueType("busiStatus");
		otherAuditInfo.setAuditStatusValue(200);
		otherAuditInfo.setAuditStatus("4");
		otherAuditInfo.setPreAuditStatusType("busiStatus");
		otherAuditInfo.setPreAuditStatusValue(business.getBusiStatus());
		otherAuditInfo.setPreAuditStatus(String.valueOf(business.getBusiStatus()));
		otherAuditInfo.setRemarks("过户审核 退回修改");
		//otherAuditInfo.setOrgName(fkAuditList.getDepartmentName());
		int inserCount = otherAuditInfoMapper.insert(otherAuditInfo);
		if(inserCount < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
		
		//过户资料表修改 状态
		YwTransfer ywTransfer = new YwTransfer();
		ywTransfer.setBusiId(busiId);
		ywTransfer.setDpStatus(1);
		ywTransfer = ywTransferMapper.selectRefined(ywTransfer);
		
		if(null == ywTransfer || ("").equals(ywTransfer))
		{
			return;
		}
		
		YwTransfer fTransfer = new YwTransfer();
		fTransfer.setId(ywTransfer.getId());
		fTransfer.setStatusTransfer(20);
		updateCount = ywTransferMapper.updateByPrimaryKeySelective(fTransfer);
		if(updateCount < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
	}
	
	
	/*  
	*  @author  zhangpp
	*  <p>Title:  deleteQianzl</p>  
	*  <p>Description:  </p>  
	*  @param bussId
	*  @param currentUser
	*  @return  
	*  @see com.zjdiepu.www.ibiz.zpp.YwShenQingZxService#deleteQianzl(java.lang.String, com.zjdiepu.www.base.core.AbstractSysUser)  
	*  @version  V1.0
	*/
	@Override
	public int deleteQianzl(String bussId, AbstractSysUser currentUser) {
		
		
		YwBusiness ywBusiness = ywBusinessMapper.selectByPrimaryKey(bussId);
		if(null == ywBusiness || ("").equals(ywBusiness))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		}
		
		//是欠资料状态
		if(ywBusiness.getLessInformationStatus() == 10)
		{
			return 1;
		}
		
		//删除资料补齐
		String sqlXmls = "update fk_audit_list t set t.dp_status = 3,t.status_list = 4 where t.busi_id = '"+bussId+"' and t.mode_id = 'M_zlbqsh' and t.status_list = 1";
		int updateCount = publicDao.updateWhereSqlXmls(sqlXmls);
		if(updateCount == 0)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),ResultFlagType.MISSING.getValue());
		} 
		else if(updateCount > 1)
		{
			throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),ResultFlagType.MULTI_DATA.getValue());
		}
		return 0;
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  examineImplement</p>  
	*  <p>Description:  </p>  
	*  @param otherAuditInfo
	*  @param currentUser  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#examineImplement(com.zjdiepu.www.model.other.dto.OtherAuditInfo, com.zjdiepu.www.base.core.AbstractSysUser)  
	*  @version  V1.0
	*/
	@SuppressWarnings("unused")
	@Override
	public void diepuExamineImplement(OtherAuditInfo otherAuditInfo,AbstractSysUser currentUser)
	{
		
		
		String userId = currentUser.getId();
		String uName = currentUser.getName();
		
		String busiId = otherAuditInfo.getBusiId();
		String modeId = otherAuditInfo.getModeId();
		
		//待审批列表主键
		String replaceId = otherAuditInfo.getId();
		
		String auditDetail = otherAuditInfo.getAuditDetail();
		String auditPostil = otherAuditInfo.getAuditPostil();
		
		String orgCode = otherAuditInfo.getOrgCode();
		String orgName = otherAuditInfo.getOrgName();
		
		//修改状态
		int busiStatus = 0;
		//审批值
		int statusList = 0;
		
		//审批记录数据编号
		String dataId = "";
		
		//待审批列表名称
		String auditName = "";
		
		//退押金状态
		int refundDepositStatus = 0;
		
		//代垫资状态
		int insteadPaymentStatus = 0;
		
		//提车信息状态
		int pickCarStatus = 0;
		
		//通融审核
		int tongrong_status = 0;
		
		//资金流出状态
		int addedStatus1 = 0;
		
		//垫款调整信息状态
		int remit_adjust_status = 0;
		
		//业务信息表时间
		//Date pickCarTime = new Date();
		
		//查询业务信息表
		YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
		
		if(null == business || ("").equals(business))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"ywBusiness is null");
		}
		
		//稽核审核
		if(modeId.equals("M_jhsc"))
		{
			//修改状态
			busiStatus = 290;
			//审批值
			statusList = 2;
			
			auditName = "稽核审核";
			
			//修改业务状态
			YwBusiness ywBusiness = new YwBusiness();
			ywBusiness.setId(busiId);
			ywBusiness.setBusiStatus(busiStatus);
			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update ywBusiness fail");
			}
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改 fkAuditList 状态
			fkAuditList.setStatusList(statusList);
			updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update fkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update fkAuditList fail");
			}
			
			
			//插入M_cwshy （财务审核一）
			fkAuditList.initInsertData(userId, uName);
			fkAuditList.setStatusList(1);
			fkAuditList.setModeId("M_cwshy");
			fkAuditList.setSource(auditName);
			fkAuditList.setOperatorId("");
			fkAuditList.setOperatorName("");
			fkAuditList.setAuditDetail("");
			fkAuditList.setAuditPostil("");
			int insertCount = fkAuditListMapper.insert(fkAuditList);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert fkAuditList fail");
			} 
		}
		//财务审核一
		else if(modeId.equals("M_cwshy"))
		{
			//修改状态
			addedStatus1 = 200;
			//审批值
			statusList = 2;
			
			auditName = "财务审核一";
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//大额审批金额  系统参数表
			double money = Double.valueOf(SysParamsType.LARGE_INSTEAD_PAYMENT.getDefaultValue().toString());
			String paramValue = baseSysParamsService.getValueByCode(SysParamsType.LARGE_INSTEAD_PAYMENT.getCode());
			if(StringUtils.isNotBlank(paramValue)) 
			{
				money = Double.parseDouble(paramValue);
			}
			
			//修改 fkAuditList 状态
			fkAuditList.setStatusList(statusList);
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update fkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update fkAuditList fail");
			}
			
			//如果当前的金额大于  系统参数大额审批  则插入大额审批数据，否则则改状态为打款中 320
			if(fkAuditList.getLoanAmount() > money)
			{
				//大额状态
				addedStatus1 = 150;
				
				//插入大额审批记录  M_dedksp
				fkAuditList.initInsertData(userId, uName);
				fkAuditList.setStatusList(1);
				fkAuditList.setModeId("M_dedksp");
				fkAuditList.setSource(auditName);
				fkAuditList.setOperatorId("");
				fkAuditList.setOperatorName("");
				fkAuditList.setAuditDetail("");
				fkAuditList.setAuditPostil("");
				int insertCount = fkAuditListMapper.insert(fkAuditList);
				if(insertCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert fkAuditList fail");
				} 
				
				//修改业务状态
				YwBusiness ywBusiness = new YwBusiness();
				ywBusiness.setId(busiId);
				ywBusiness.setAddedStatus1(addedStatus1);
				updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update ywBusiness fail");
				}
			}
			else
			{
				//垫提车款
				addedStatus1 = 200;
				
				//修改业务状态
				YwBusiness ywBusiness = new YwBusiness();
				ywBusiness.setId(busiId);
				ywBusiness.setAddedStatus1(addedStatus1);
				updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update ywBusiness fail");
				}
			}
		}
		//财务审核二
		else if(modeId.equals("M_cwshe"))
		{
			//修改状态
			busiStatus = 320;
			//审批值
			statusList = 2;
			
			auditName = "财务审核二";
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//大额审批金额  系统参数表
			double money = Double.valueOf(SysParamsType.LARGE_INSTEAD_PAYMENT.getDefaultValue().toString());
			String paramValue = baseSysParamsService.getValueByCode(SysParamsType.LARGE_INSTEAD_PAYMENT.getCode());
			if(StringUtils.isNotBlank(paramValue)) 
			{
				money = Double.parseDouble(paramValue);
			}
			
			//修改 fkAuditList 状态
			fkAuditList.setStatusList(statusList);
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update fkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update fkAuditList fail");
			}
			
			//如果当前的金额大于  系统参数大额审批  则插入大额审批数据，否则则改状态为打款中 320
			if(fkAuditList.getLoanAmount() > money)
			{
				//如果是大额审批插入  则状态还是不变
				busiStatus = 300;
				
				//插入大额审批记录  M_dedksp
				fkAuditList.initInsertData(userId, uName);
				fkAuditList.setStatusList(1);
				fkAuditList.setModeId("M_dedksp");
				fkAuditList.setSource(auditName);
				fkAuditList.setOperatorId("");
				fkAuditList.setOperatorName("");
				fkAuditList.setAuditDetail("");
				fkAuditList.setAuditPostil("");
				int insertCount = fkAuditListMapper.insert(fkAuditList);
				if(insertCount < 1)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert fkAuditList fail");
				} 
			}
			else
			{
				//修改业务状态
				YwBusiness ywBusiness = new YwBusiness();
				ywBusiness.setId(busiId);
				ywBusiness.setBusiStatus(busiStatus);
				updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
				if(updateCount == 0)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
				} 
				else if(updateCount > 1)
				{
					throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update ywBusiness fail");
				}
			}
		}
		//退押金催收审核
		else if(modeId.equals("M_tyjcssh"))
		{
			//修改状态
			refundDepositStatus = 13;
			//审批值
			statusList = 2;
			//模块名称
			auditName = "退押金催收审核";
			
			
			//查询退押金表
			DhDepositMoney dhDepositMoney = new DhDepositMoney();
			dhDepositMoney.setBusiId(busiId);
			dhDepositMoney.setDpStatus(1);
			dhDepositMoney = dhDepositMoneyMapper.selectRefined(dhDepositMoney);
			if(null == dhDepositMoney || ("").equals(dhDepositMoney))
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"dhDepositMoney is null");
			}
			//审批记录数据编号
			dataId = dhDepositMoney.getId();
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改审核状态
			FkAuditList auditList = new FkAuditList();
			auditList.setId(fkAuditList.getId());
			auditList.setStatusList(statusList);
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
			}
			
			//插入退押金续保审核  
			fkAuditList.initInsertData(userId, uName);
			fkAuditList.setSource("退押金催收审核");
			fkAuditList.setModeId("M_tyjxbsh");
			fkAuditList.setDpStatus(1);
			fkAuditList.setOperatorId("");
			fkAuditList.setOperatorName("");
			fkAuditList.setAuditDetail("");
			fkAuditList.setAuditPostil("");
			int insertCount = fkAuditListMapper.insert(fkAuditList);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"insert fkAuditList fail");
			}
			
			//修改退押金状态
			DhDepositMoney depositMoney = new DhDepositMoney();
			depositMoney.setId(dhDepositMoney.getId());
			depositMoney.setStatusRefundDeposit(13);
			updateCount = dhDepositMoneyMapper.updateByPrimaryKeySelective(depositMoney);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update DhDepositMoney fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update DhDepositMoney fail");
			}
		}
		//退押金续保审核
		else if(modeId.equals("M_tyjxbsh"))
		{
			//修改状态
			refundDepositStatus = 20;
			//审批值
			statusList = 2;
			//模块名称
			auditName = "退押金续保审核";
			
			
			//查询退押金表
			DhDepositMoney dhDepositMoney = new DhDepositMoney();
			dhDepositMoney.setBusiId(busiId);
			dhDepositMoney.setDpStatus(1);
			dhDepositMoney = dhDepositMoneyMapper.selectRefined(dhDepositMoney);
			if(null == dhDepositMoney || ("").equals(dhDepositMoney))
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"dhDepositMoney is null");
			}
			//审批记录数据编号
			dataId = dhDepositMoney.getId();
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改审核状态
			FkAuditList auditList = new FkAuditList();
			auditList.setId(fkAuditList.getId());
			auditList.setStatusList(statusList);
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
			}
			
			//修改退押金状态
			DhDepositMoney depositMoney = new DhDepositMoney();
			depositMoney.setId(dhDepositMoney.getId());
			depositMoney.setStatusRefundDeposit(13);
			updateCount = dhDepositMoneyMapper.updateByPrimaryKeySelective(depositMoney);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update DhDepositMoney fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update DhDepositMoney fail");
			}
		}
		//代偿稽核审核
		else if(modeId.equals("M_dcjhsc"))
		{
			//修改状态
			insteadPaymentStatus = 25;
			//审批值
			statusList = 2;
			//模块名称
			auditName = "退押金续保审核";
			
			//查询垫资表数据
			DhInsteadPayment dhInsteadPayment = new DhInsteadPayment();
			dhInsteadPayment.setBusiId(busiId);
			dhInsteadPayment.setDpStatus(1);
			dhInsteadPayment = dhInsteadPaymentMapper.selectRefined(dhInsteadPayment);
			if(null == dhInsteadPayment || ("").equals(dhInsteadPayment))
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"dhInsteadPayment is null");
			}
			
			//审批记录数据编号
			dataId = dhInsteadPayment.getId();
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改审核状态
			FkAuditList auditList = new FkAuditList();
			auditList.setId(fkAuditList.getId());
			auditList.setStatusList(statusList);
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
			}
			
			//修改垫资状态
			DhInsteadPayment payment = new DhInsteadPayment();
			payment.setId(dhInsteadPayment.getId());
			payment.setStatusInstead(insteadPaymentStatus);
			updateCount = dhInsteadPaymentMapper.updateByPrimaryKeySelective(payment);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update DhDepositMoney fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update DhDepositMoney fail");
			}
		}
		//新车提车审核
		else if(modeId.equals("M_xctcsh"))
		{
			//修改状态
			pickCarStatus = 50;
			//审批值
			statusList = 2;
			//模块名称
			auditName = "新车提车审核";
			//主业务状态
			busiStatus = 400;
			
			
			//查询新车提车
			DzPickCar dzPickCar = new DzPickCar();
			dzPickCar.setBusiId(busiId);
			dzPickCar.setDpStatus(1);
			dzPickCar = dzPickCarMapper.selectRefined(dzPickCar);
			if(null == dzPickCar || ("").equals(dzPickCar))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"dzPickCar is null");
			}
			
			YwBusiness ywBusiness = new YwBusiness();
			ywBusiness.setId(busiId);
			ywBusiness.setBusiStatus(busiStatus);
			ywBusiness.setPickCarTime(dzPickCar.getPickCarTime());
			int insertCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
			}
		
			//审批记录数据编号
			dataId = dzPickCar.getId();
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改审核状态
			FkAuditList auditList = new FkAuditList();
			auditList.setId(fkAuditList.getId());
			auditList.setStatusList(statusList);
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
			}
			
			//修改新车提车状态
			DzPickCar pickCar = new DzPickCar();
			pickCar.setId(dzPickCar.getId());
			pickCar.setPickCarStatus(pickCarStatus);
			updateCount = dzPickCarMapper.updateByPrimaryKeySelective(pickCar);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update DzPickCar fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update DzPickCar fail");
			}
			
			/**新车提车审核  额外事件**/
			
			
			
//			
//			//客户号
//			String  customerId = business.getCustomerId();
//			//审核金额
//			double loanAmount = fkAuditList.getLoanAmount();
//			//通道类型
//			String channelType = fkAuditList.getChannelType();
//			//经销商
//			String dealerId = business.getDealerId();
//			//银行
//			String bankLoan = fkAuditList.getBankname();
//			//业务金额
//			double realLoanAmount = business.getRealLoanAmount();
//			
//			//添加待投保列表
//			FkInsureList fkInsureList = new FkInsureList();
//			fkInsureList.initInsertData(currentUser.getId(), currentUser.getName());
//			fkInsureList.setCusId(customerId);
//			fkInsureList.setBusiId(busiId);
//			fkInsureList.setLoanAmount(loanAmount);
//			fkInsureList.setChannelType(channelType);
//			
//			BaseCustomer baseCustomer = baseCustomerMapper.selectByPrimaryKey(customerId);
//			fkInsureList.setCusName(baseCustomer.getName());
//			fkInsureList.setCusIdno(baseCustomer.getCusNo());
//			String salesmanId = baseCustomer.getSalesmanId();
//			BaseSalersman baseSalersman = baseSalersmanMapper.selectByPrimaryKey(salesmanId);
//			fkInsureList.setSalersmanName(baseSalersman.getName());
//			String unitId = baseSalersman.getUnitId();
//			BaseBusiUnit baseBusiUnit = baseBusiUnitMapper.selectByPrimaryKey(unitId);
//			fkInsureList.setDepartmentName(baseBusiUnit.getOrgName());
//			
//			DpBaseDealerInfo dpBaseDealerInfo = dpBaseDealerInfoMapper.selectByPrimaryKey(dealerId);
//			fkInsureList.setDealer(dpBaseDealerInfo.getDealerName());
//			
//			DhArchiveExt dhArchiveExt = new DhArchiveExt();
//			dhArchiveExt.setCusId(customerId);
//			dhArchiveExt.setBusiId(busiId);
//			dhArchiveExt.setRows(1);
//			List<DhArchive> dhArchives = dhArchiveMapper.selectByExt(dhArchiveExt);	
//			if(CollectionUtils.isNotEmpty(dhArchives)) {
//				DhArchive dhArchive = dhArchives.get(0);
//				fkInsureList.setNoRecord(dhArchive.getNoRecord());
//			}
//			
//			String dealerLevel = dpBaseDealerInfo.getDealerLevel();
//			
//			//GPS待加装列表
//			YwBusinessExtrasExt ywBusinessExtrasExt = new YwBusinessExtrasExt();
//			ywBusinessExtrasExt.setBaseWhere();
//			ywBusinessExtrasExt.setRows(1);
//			ywBusinessExtrasExt.setTypeExtras(BusinessExtrasCodeType.ADD_GPS.getCode());
//			ywBusinessExtrasExt.setBusiId(busiId);
//			List<YwBusinessExtras> ywBusinessExtrases = ywBusinessExtrasMapper.selectByExt(ywBusinessExtrasExt);
//			YwBusinessExtras ywBusinessExtras = null;
//			if(CollectionUtils.isNotEmpty(ywBusinessExtrases)) {
//				ywBusinessExtras = ywBusinessExtrases.get(0);
//			}
//			
//			DzGpsList dzGpsList = new DzGpsList();
//			dzGpsList.setBusiId(busiId);
//			dzGpsList.setCusId(customerId);
//			dzGpsList.setDpStatus(DpStatus.NORMAL.getCode());
//			int hasCount = dzGpsListMapper.countRefined(dzGpsList);
//			int valueExtra = 0;
//			if(null != ywBusinessExtras && hasCount == 0) {
//				String valueExtras = ywBusinessExtras.getValueExtras();
//				if(StringUtils.isNotBlank(valueExtras)) {
//					try 
//					{
//						valueExtra = Integer.parseInt(valueExtras.trim());
//						if(valueExtra != 0) {
//							dzGpsList.initInsertData(currentUser.getId(), currentUser.getName());
//							
//							dzGpsList.setNumGps(valueExtra);
//							dzGpsList.setLoanAmount(realLoanAmount);
//							dzGpsList.setChannelType(channelType);
//							dzGpsList.setDealerLevel(dealerLevel);
//							dzGpsList.setDealer(dpBaseDealerInfo.getDealerName());
//							dzGpsList.setDepartmentName(baseBusiUnit.getOrgName());
//							dzGpsList.setSalersmanName(baseSalersman.getName());
//							dzGpsList.setCusName(baseCustomer.getName());
//							dzGpsList.setCusIdno(baseCustomer.getCusNo());
//							
//						}
//					} 
//					catch (NumberFormatException e) 
//					{
//						//不是数字,不需要待加装GPS
//						valueExtra = 0;
//					}
//				}
//			}
//			
//			//redis 取值
//			redisObjectClient.execute(new RedisCallback<Boolean>() {
//				@Override
//				public Boolean doInRedis(RedisConnection redisConnection)throws DataAccessException 
//				{
//					SimpleDataDictionary simpleDataDictionary = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), dealerLevel, DataDicType.DEALER_LEVEL.getCode());
//					if(null != simpleDataDictionary)
//					{
//						fkInsureList.setDealerLevel(simpleDataDictionary.getName());
//						dzGpsList.setDealerLevel(simpleDataDictionary.getName());
//					}
//					
//					SimpleDataDictionary simpleDataDictionary1 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), bankLoan, DataDicType.LOAN_BANK.getCode());
//					if(null != simpleDataDictionary1)
//					{
//						fkInsureList.setBankname(simpleDataDictionary1.getName());
//						dzGpsList.setBankname(simpleDataDictionary1.getName());
//					}
//					
//					SimpleDataDictionary simpleDataDictionary2 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), channelType, DataDicType.CHANNEL_TYPE.getCode());
//					if(null != simpleDataDictionary2)
//					{
//						fkInsureList.setChannelTypeName(simpleDataDictionary2.getName());
//						dzGpsList.setChannelTypeName(simpleDataDictionary2.getName());
//					}
//					return true;
//				}
//			});
//			
//			fkInsureList.setInsuranceStatus(InsuranceStatus.DAI_BAO.getCode());
//			
//			//去掉【往“dh_待投保列表”增加一条数据，投保状态为“待保”；】
//			//fkInsureListMapper.insert(fkInsureList);
//			
//			if(valueExtra != 0 && hasCount == 0) 
//			{
//				dzGpsList.setStatusGpsList(GPSListStatus.WEI_TI_JIAO.getCode());
//				
//				//如果 yw_业务信息_附加信息 对应的gps个数大于0，则往‘dz_gps待加装列表’增加一条数据，GPS待加装信息状态为‘未提交’
//				//dzGpsListMapper.insert(dzGpsList);
//			}
			
		}
		//通融区域经理审核
		else if(modeId.equals("M_trqyjlsh"))
		{
			//修改状态
			tongrong_status = 25;
			//审批值
			statusList = 2;
			
			auditName = "通融区域经理审核";
			
			//修改业务状态
			YwBusiness ywBusiness = new YwBusiness();
			ywBusiness.setId(busiId);
			ywBusiness.setTongrongStatus(tongrong_status);
			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusiness fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update ywBusiness fail");
			}
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改 fkAuditList 状态
			fkAuditList.setStatusList(statusList);
			updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update fkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update fkAuditList fail");
			}
			
			//插入通融审核记录
			fkAuditList.initInsertData(userId,uName);
			fkAuditList.setModeId("M_trsh");
			fkAuditList.setSource(auditName);
			fkAuditList.setStatusList(1);
			fkAuditList.setOperatorId("");
			fkAuditList.setOperatorName("");
			fkAuditList.setAuditDetail("");
			fkAuditList.setAuditPostil("");
			int insertCount = fkAuditListMapper.insert(fkAuditList);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"insert fkAuditList fail");
			}
		}
		else if(modeId.equals("M_dktzbsh"))
		{
			//垫款调整信息状态
			remit_adjust_status = 50;
			//审批值
			statusList = 2;
			//模块名称
			auditName = "垫款调整B审核";
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改 fkAuditList 状态
			fkAuditList.setStatusList(statusList);
			int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(fkAuditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update fkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update fkAuditList fail");
			}
			
			//查询
			CwRemitAdjustB cwRemitAdjustB = new CwRemitAdjustB();
			cwRemitAdjustB.setBusiId(busiId);
			cwRemitAdjustB.setDpStatus(1);
			cwRemitAdjustB = cwRemitAdjustBMapper.selectRefined(cwRemitAdjustB);
			if(null == cwRemitAdjustB || ("").equals(cwRemitAdjustB))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"cwRemitAdjustB is null");
			}
			
			CwRemitAdjustB remitAdjustB = new CwRemitAdjustB();
			remitAdjustB.setId(cwRemitAdjustB.getId());
			remitAdjustB.setBusiId(busiId);
			remitAdjustB.setRemitAdjustStatus(remit_adjust_status);
			updateCount = cwRemitAdjustBMapper.updateByPrimaryKeySelective(remitAdjustB);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update cwRemitAdjustB fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update cwRemitAdjustB fail");
			}
		}
		
		//--------------预警通知--------------
		
		
		//退押金催收审核   退押金催收审核
		if(modeId.equals("M_tyjcssh") || modeId.equals("M_tyjxbsh"))
		{
			//查询退押金表数据
			DhDepositMoney depositMoney = new DhDepositMoney();
			depositMoney.setBusiId(busiId);
			depositMoney.setDpStatus(1);
			depositMoney = dhDepositMoneyMapper.selectRefined(depositMoney);
			if(null == depositMoney || ("").equals(depositMoney))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"DhDepositMoney is null");
			}
			
			//插入审批记录表
			otherAuditInfo.initInsertData(userId, uName);
			otherAuditInfo.setDataId(dataId);
			otherAuditInfo.setAuditName(auditName);
			otherAuditInfo.setAuditStatusValueType("RefundDepositStatus");
			otherAuditInfo.setAuditStatusValue(refundDepositStatus);
			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
			otherAuditInfo.setAuditDetail(auditDetail);
			otherAuditInfo.setAuditPostil(auditPostil);
			otherAuditInfo.setPreAuditStatusType("RefundDepositStatus");
			otherAuditInfo.setPreAuditStatusValue(depositMoney.getStatusRefundDeposit());
			otherAuditInfo.setPreAuditStatus("1");
			//otherAuditInfo.setOrgCode(orgCode);
			//otherAuditInfo.setOrgName(orgName);
			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"insert otherAuditInfo fail");
			} 
		}
		//代偿稽核审核
		else if(modeId.equals("M_dcjhsc"))
		{
			//查询垫资表数据
			DhInsteadPayment dhInsteadPayment = new DhInsteadPayment();
			dhInsteadPayment.setBusiId(busiId);
			dhInsteadPayment.setDpStatus(1);
			dhInsteadPayment = dhInsteadPaymentMapper.selectRefined(dhInsteadPayment);
			if(null == dhInsteadPayment || ("").equals(dhInsteadPayment))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"dhInsteadPayment is null");
			}
			
			//插入审批记录表
			otherAuditInfo.initInsertData(userId, uName);
			otherAuditInfo.setDataId(dataId);
			otherAuditInfo.setAuditName(auditName);
			otherAuditInfo.setAuditStatusValueType("InsteadPaymentStatus");
			otherAuditInfo.setAuditStatusValue(refundDepositStatus);
			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
			otherAuditInfo.setAuditDetail(auditDetail);
			otherAuditInfo.setAuditPostil(auditPostil);
			otherAuditInfo.setPreAuditStatusType("InsteadPaymentStatus");
			otherAuditInfo.setPreAuditStatusValue(dhInsteadPayment.getStatusInstead());
			otherAuditInfo.setPreAuditStatus("1");
			//otherAuditInfo.setOrgCode(orgCode);
			//otherAuditInfo.setOrgName(orgName);
			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"insert otherAuditInfo fail");
			} 
		}
		//新车提车审核
		else if(modeId.equals("M_xctcsh"))
		{
			//查询新车提款
			DzPickCar dzPickCar = new DzPickCar();
			dzPickCar.setBusiId(busiId);
			dzPickCar.setDpStatus(1);
			dzPickCar = dzPickCarMapper.selectRefined(dzPickCar);
			if(null == dzPickCar || ("").equals(dzPickCar))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"dzPickCar is null");
			}
			
			//插入审批记录表
			otherAuditInfo.initInsertData(userId, uName);
			otherAuditInfo.setDataId(dataId);
			otherAuditInfo.setAuditName(auditName);
			otherAuditInfo.setAuditStatusValueType("PickCarStatus");
			otherAuditInfo.setAuditStatusValue(pickCarStatus);
			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
			otherAuditInfo.setAuditDetail(auditDetail);
			otherAuditInfo.setAuditPostil(auditPostil);
			otherAuditInfo.setPreAuditStatusType("PickCarStatus");
			otherAuditInfo.setPreAuditStatusValue(dzPickCar.getPickCarStatus());
			otherAuditInfo.setPreAuditStatus("1");
			//otherAuditInfo.setOrgCode(orgCode);
			//otherAuditInfo.setOrgName(orgName);
			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"insert otherAuditInfo fail");
			} 
		}
		//垫款调整B审核
		else if(modeId.equals("M_dktzbsh"))
		{
			CwRemitAdjustB cwRemitAdjustB = new CwRemitAdjustB();
			cwRemitAdjustB.setBusiId(busiId);
			cwRemitAdjustB.setDpStatus(1);
			cwRemitAdjustB = cwRemitAdjustBMapper.selectRefined(cwRemitAdjustB);
			if(null == cwRemitAdjustB || ("").equals(cwRemitAdjustB))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"cwRemitAdjustB is null");
			}
			
			//插入审批记录表
			otherAuditInfo.initInsertData(userId, uName);
			otherAuditInfo.setDataId(dataId);
			otherAuditInfo.setAuditName(auditName);
			otherAuditInfo.setAuditStatusValueType("remitAdjustStatus");
			otherAuditInfo.setAuditStatusValue(pickCarStatus);
			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
			otherAuditInfo.setAuditDetail(auditDetail);
			otherAuditInfo.setAuditPostil(auditPostil);
			otherAuditInfo.setPreAuditStatusType("remitAdjustStatus");
			otherAuditInfo.setPreAuditStatusValue(cwRemitAdjustB.getRemitAdjustStatus());
			otherAuditInfo.setPreAuditStatus("1");
			//otherAuditInfo.setOrgCode(orgCode);
			//otherAuditInfo.setOrgName(orgName);
			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"insert otherAuditInfo fail");
			} 
		}
		//通融区域经理审核
		else if(modeId.equals("M_trqyjlsh"))
		{
			//插入审批记录表
			otherAuditInfo.initInsertData(userId, uName);
			otherAuditInfo.setDataId(dataId);
			otherAuditInfo.setAuditName(auditName);
			otherAuditInfo.setAuditStatusValueType("tongrong_status");
			otherAuditInfo.setAuditStatusValue(tongrong_status);
			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
			otherAuditInfo.setAuditDetail(auditDetail);
			otherAuditInfo.setAuditPostil(auditPostil);
			otherAuditInfo.setPreAuditStatusType("tongrong_status");
			otherAuditInfo.setPreAuditStatusValue(business.getBusiStatus());
			otherAuditInfo.setPreAuditStatus("1");
			//otherAuditInfo.setOrgCode(orgCode);
			//otherAuditInfo.setOrgName(orgName);
			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert otherAuditInfo fail");
			} 
		}
		//财务审核一
		else if(modeId.equals("M_cwshy"))
		{
			//插入审批记录表
			otherAuditInfo.initInsertData(userId, uName);
			otherAuditInfo.setDataId(dataId);
			otherAuditInfo.setAuditName(auditName);
			otherAuditInfo.setAuditStatusValueType("added_status1");
			otherAuditInfo.setAuditStatusValue(addedStatus1);
			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
			otherAuditInfo.setAuditDetail(auditDetail);
			otherAuditInfo.setAuditPostil(auditPostil);
			otherAuditInfo.setPreAuditStatusType("added_status1");
			otherAuditInfo.setPreAuditStatusValue(business.getAddedStatus1());
			otherAuditInfo.setPreAuditStatus("1");
			//otherAuditInfo.setOrgCode(orgCode);
			//otherAuditInfo.setOrgName(orgName);
			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert otherAuditInfo fail");
			} 
		}
		else
		{
			//插入审批记录表
			otherAuditInfo.initInsertData(userId, uName);
			otherAuditInfo.setDataId(dataId);
			otherAuditInfo.setAuditName(auditName);
			otherAuditInfo.setAuditStatusValueType("BusiStatus");
			otherAuditInfo.setAuditStatusValue(busiStatus);
			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
			otherAuditInfo.setAuditDetail(auditDetail);
			otherAuditInfo.setAuditPostil(auditPostil);
			otherAuditInfo.setPreAuditStatusType("BusiStatus");
			otherAuditInfo.setPreAuditStatusValue(business.getBusiStatus());
			otherAuditInfo.setPreAuditStatus("1");
			//otherAuditInfo.setOrgCode(orgCode);
			//otherAuditInfo.setOrgName(orgName);
			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
			if(insertCount < 1)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert otherAuditInfo fail");
			}
		}
		
		//新车提车审核  
		if(modeId.equals("M_xctcsh"))
		{
			//查询车辆信息
			YwBusinessCar ywBusinessCar = new YwBusinessCar();
			ywBusinessCar.setBusiId(busiId);
			ywBusinessCar.setDpStatus(1);
			ywBusinessCar = ywBusinessCarMapper.selectRefined(ywBusinessCar);
			if(null == ywBusinessCar || ("").equals(ywBusinessCar))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"ywBusinessCar is null");
			}
			
			//删除提车预警信息
			OtherWantWarning otherWantWarning = new OtherWantWarning();
			otherWantWarning.setBusiId(busiId);
			otherWantWarning.setModeId(ModeIDType.TC.getCode());
			otherWantWarningMapper.deletedReal(otherWantWarning);
			
			//上牌预警
			OtherWantWarning otherWantWarning_ = new OtherWantWarning();
			otherWantWarning_.initInsertData(currentUser.getId(), currentUser.getName());
			otherWantWarning_.setModeId(ModeIDType.SP.getCode());
			otherWantWarning_.setBusiId(busiId);
			otherWantWarning_.setDataid(ywBusinessCar.getId());
			otherWantWarning_.setTypeMsg("03");
			otherWantWarning.setTypeMsgEvent("23");
			
			//获取地区配置================
			OtherWarningConfiguration otherWarningConfiguration = otherWarningConfigurationService.getOtherWarningConfigurationBySalesmanId(SysParamsType.SHANG_PAI_CHAO_QI_YU_JING.getCode(), business.getSalesmanId());
			Integer warningDay = null;
			if(null != otherWarningConfiguration)
			{
				warningDay = otherWarningConfiguration.getWarningDay();
			}
			
			//获取系统参数配置================
			if(null == warningDay) 
			{
				String paramValue = baseSysParamsService.getValueByCode(SysParamsType.SHANG_PAI_CHAO_QI_YU_JING.getCode());
				if(StringUtils.isNotBlank(paramValue)) {
					warningDay = Integer.valueOf(paramValue);
				}
			}
			
			//获取默认配置================
			if(null == warningDay) 
			{
				warningDay = (Integer)SysParamsType.SHANG_PAI_CHAO_QI_YU_JING.getDefaultValue();
			}
			
			if(null == warningDay) 
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"预警：time is null");
			}
			
			Date nextWorkDate = otherHolidaysService.getNextWorkDate(new Date(), "1", warningDay);
			otherWantWarning_.setTimeWarning(nextWorkDate);
			otherWantWarning_.setStatusMsg(1);
			
			
			//审核预警通知
			String customerName = business.getCustomerName();
			OtherMessageApp spAlertMsg = new OtherMessageApp();
			spAlertMsg.setModeId(ModeIDType.SP.getCode());
			spAlertMsg.setBusiId(busiId);
			spAlertMsg.setDataid(ywBusinessCar.getId());
			spAlertMsg.setTypeMsg("03");
			spAlertMsg.setTypeMsgEvent("23");
			spAlertMsg.setNotificationBar("客户" + customerName + "的订单 请尽快上牌");
			spAlertMsg.setTitle("客户" + customerName + "的订单 请尽快上牌");
			spAlertMsg.setContent("预警：客户" + customerName + "的订单 请尽快上牌");
			spAlertMsg.setTimeCreate(new Date());
			String tcShortMessage = "预警：客户" + customerName + "的订单 请尽快上牌";
			serviceHelper.saveAlert(otherWantWarning_, spAlertMsg, business.getCustomerId(), customerName, tcShortMessage, currentUser);
			return;
		}
		
		//审核预警通知
		String customerName = business.getCustomerName();
		OtherMessageApp otherMessageApp_ = new OtherMessageApp();
		otherMessageApp_.setModeId(ModeIDType.TC.getCode());
		otherMessageApp_.setBusiId(business.getId());
		otherMessageApp_.setDataid(dataId);
		otherMessageApp_.setTypeMsg("01");
		otherMessageApp_.setTypeMsgEvent(NewsType.TZ08.getCode());
		otherMessageApp_.setNotificationBar(customerName + "的"+auditName+"审核成功");
		otherMessageApp_.setTitle(customerName + "的"+auditName+"审核成功");
		otherMessageApp_.setContent("通知：" + customerName + "的"+auditName+"审核成功，审核结果：正常");
		Date now = new Date();
		otherMessageApp_.setTimeCreate(now);
		otherMessageApp_.setTimeSend(now);
		otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
//		String shortMessage_ = "客户" + customerName +"的"+auditName+"审核成功，请登录系统查看详情！";
		//serviceHelper.saveMsg(otherMessageApp_, business.getCustomerId(), customerName, shortMessage_, currentUser, logger);
		//审核预警通知
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  selectByExtCaiWu</p>  
	*  <p>Description:  </p>  
	*  @param fkAuditListExt
	*  @return  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#selectByExtCaiWu(com.zjdiepu.www.model.fk.ext.FkAuditListExt)  
	*  @version  V1.0
	*/
	@Override
	public List<FkAuditList> selectByExtCaiWu(FkAuditListExt fkAuditListExt) {
		
		return fengKongShenHeDao.selectByExtCaiWu(fkAuditListExt);
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  selectByExtCaiWuCount</p>  
	*  <p>Description:  </p>  
	*  @param fkAuditListExt
	*  @return  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#selectByExtCaiWuCount(com.zjdiepu.www.model.fk.ext.FkAuditListExt)  
	*  @version  V1.0
	*/
	@Override
	public int selectByExtCaiWuCount(FkAuditListExt fkAuditListExt) {
		
		return fengKongShenHeDao.selectByExtCaiWuCount(fkAuditListExt);
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  examineImplementFail</p>  
	*  <p>Description:  </p>  
	*  @param otherAuditInfo
	*  @param currentUser  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#examineImplementFail(com.zjdiepu.www.model.other.dto.OtherAuditInfo, com.zjdiepu.www.base.core.AbstractSysUser)  
	*  @version  V1.0
	*/
	@SuppressWarnings("unused")
	@Override
	public void diepuExamineImplementFail(OtherAuditInfo otherAuditInfo,AbstractSysUser currentUser) 
	{
		
		
		
		String userId = currentUser.getId();
		String uName = currentUser.getName();
		
		String busiId = otherAuditInfo.getBusiId();
		String modeId = otherAuditInfo.getModeId();
		
		//待审批列表主键
		String replaceId = otherAuditInfo.getId();
		
		String auditDetail = otherAuditInfo.getAuditDetail();
		String auditPostil = otherAuditInfo.getAuditPostil();
		
		String orgCode = otherAuditInfo.getOrgCode();
		String orgName = otherAuditInfo.getOrgName();
		
		//修改状态
		int busiStatus = 0;
		//审批值
		int statusList = 3;
		
		//审批记录数据编号
		String dataId = "";
		
		//待审批列表名称
		String auditName = "";
		
		//通融状态
		int tongrongStatus = 0;
		
		
		//查询业务信息表
		YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
		
		if(null == business || ("").equals(business))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"ywBusiness is null");
		}
		
		//通融区域经理审核
		if(modeId.equals("M_trqyjlsh"))
		{
			//修改状态
			busiStatus = 9080;
			//模块名称
			auditName = "通融区域经理审核";
			//通融状态
			tongrongStatus = 50;
			
			//修改业务信息
			YwBusiness ywBusiness = new YwBusiness();
			ywBusiness.setId(busiId);
			ywBusiness.setBusiStatus(busiStatus);
			ywBusiness.setTongrongStatus(tongrongStatus);
			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update YwBusiness fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update YwBusiness fail");
			}
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改审核状态
			FkAuditList auditList = new FkAuditList();
			auditList.setId(fkAuditList.getId());
			auditList.setStatusList(statusList);
			updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
			}
		}
		//初审单初审
		else if(modeId.equals("M_csdcs"))
		{
			//修改状态
			busiStatus = 20;
			//模块名称
			auditName = "初审一审";
			
			//退回修改
			statusList = 8;
			
			//修改业务信息
			YwBusiness ywBusiness = new YwBusiness();
			ywBusiness.setId(busiId);
			ywBusiness.setBusiStatus(busiStatus);
			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update YwBusiness fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update YwBusiness fail");
			}
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改审核状态
			FkAuditList auditList = new FkAuditList();
			auditList.setId(fkAuditList.getId());
			auditList.setStatusList(statusList);
			updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
			}
		}
		//初审单终审
		else if(modeId.equals("M_csdzs"))
		{
			//修改状态
			busiStatus = 20;
			//模块名称
			auditName = "初审二审";
			
			//退回修改
			statusList = 8;
			
			//修改业务信息
			YwBusiness ywBusiness = new YwBusiness();
			ywBusiness.setId(busiId);
			ywBusiness.setBusiStatus(busiStatus);
			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update YwBusiness fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update YwBusiness fail");
			}
			
			//查询待审批列表
			FkAuditList fkAuditList = fkAuditListMapper.selectByPrimaryKey(replaceId);
			if(null == fkAuditList || ("").equals(fkAuditList))
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
			}
			
			//审批记录数据编号
			dataId = fkAuditList.getId();
			
			//经办部门
			orgName = fkAuditList.getDepartmentName();
			
			//修改审核状态
			FkAuditList auditList = new FkAuditList();
			auditList.setId(fkAuditList.getId());
			auditList.setStatusList(statusList);
			updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
			if(updateCount == 0)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
			} 
			else if(updateCount > 1)
			{
				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
			}
		}
		
		//插入审批记录表
		otherAuditInfo.initInsertData(userId, uName);
		otherAuditInfo.setDataId(dataId);
		otherAuditInfo.setAuditName(auditName);
		otherAuditInfo.setAuditStatusValueType("BusiStatus");
		otherAuditInfo.setAuditStatusValue(busiStatus);
		otherAuditInfo.setAuditStatus(String.valueOf(statusList));
		otherAuditInfo.setAuditDetail(auditDetail);
		otherAuditInfo.setAuditPostil(auditPostil);
		otherAuditInfo.setPreAuditStatusType("BusiStatus");
		otherAuditInfo.setPreAuditStatusValue(business.getBusiStatus());
		otherAuditInfo.setPreAuditStatus("1");
		//otherAuditInfo.setOrgCode(orgCode);
		//otherAuditInfo.setOrgName(orgName);
		int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
		if(insertCount < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert otherAuditInfo fail");
		}
		
		//审核预警通知
		String customerName = business.getCustomerName();
		OtherMessageApp otherMessageApp_ = new OtherMessageApp();
		otherMessageApp_.setModeId(ModeIDType.TC.getCode());
		otherMessageApp_.setBusiId(business.getId());
		otherMessageApp_.setDataid(dataId);
		otherMessageApp_.setTypeMsg("01");
		otherMessageApp_.setTypeMsgEvent(NewsType.TZ09.getCode());
		otherMessageApp_.setNotificationBar(customerName + "的"+auditName+"审核不过");
		otherMessageApp_.setTitle(customerName + "的"+auditName+"审核不过");
		otherMessageApp_.setContent("通知：" + customerName + "的"+auditName+"审核不过，审核结果：正常");
		Date now = new Date();
		otherMessageApp_.setTimeCreate(now);
		otherMessageApp_.setTimeSend(now);
		otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
//		String shortMessage_ = "客户" + customerName +"的"+auditName+"审核不过，请登录系统查看详情！";
		//serviceHelper.saveMsg(otherMessageApp_, business.getCustomerId(), customerName, shortMessage_, currentUser, logger);
		//审核预警通知
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  automaticExamine</p>  
	*  <p>Description:  </p>  
	*  @param currentUser
	*  @param otherAuditInfo  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#automaticExamine(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.other.dto.OtherAuditInfo)  
	*  @version  V1.0
	*/
//	@Override
//	public void diepuAutomaticExamine(String serverRealPath,AbstractSysUser currentUser,OtherAuditInfo otherAuditInfo,String busiId) 
//	{
//		
//		
//		String userId = currentUser.getId();
//		String loginName = currentUser.getName();
//		
//		try 
//		{
//			JsonParser parse =new JsonParser();  
//			JsonObject json = (JsonObject) parse.parse(new FileReader(serverRealPath)); 
//			JsonArray  array = json.get("result").getAsJsonArray();
//			if(null == array || 0 == array.size())
//			{
//				return;
//			}
//			
//			//待审批数据
//			FkAuditList audit = new FkAuditList();
//			audit.setBusiId(busiId);
//			audit.setDpStatus(1);
//			audit.setStatusList(1);
//			FkAuditList fkAuditList = fkAuditListMapper.selectRefined(audit);
//			
//			if(null == fkAuditList || ("").equals(fkAuditList))
//			{
//				return;
//			}
//			
//			//业务信息表数据
//			YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
//			
//			
//			//循环配置
//			for(int i=0;i<array.size();i++)
//			{
//				JsonObject object = array.get(i).getAsJsonObject();
//				//模块编号
//				String mode_Id = object.get("modeId").getAsString();
//				
//				//自动审核条件调用
//				zidongShenData(currentUser,object,fkAuditList,business);
//				//执行自动审核
//				auditListUpdate(currentUser,object,fkAuditList,business);
//				
//				//额外事件  电审二审 资审二审
//				if(mode_Id.equals("M_dsfs") || mode_Id.equals("M_zses"))
//				{
//					dianShenZiShenevent(object,currentUser,business,fkAuditList);
//				}
//			}
//		} 
//		catch (Exception e) 
//		{
//			
//			e.printStackTrace();
//		}
//		
//		if(null == otherAuditInfo || null == otherAuditInfo.getModeId())
//		{
//			return;
//		}
//		
//		//模块编号
//		String modeId = otherAuditInfo.getModeId();
//		
//		if(modeId.equals("M_zsys") || modeId.equals("M_dscs"))
//		{
//			return;
//		}
//		
//		
//		//判断是否为自动审核条件
//		if(modeId.equals("M_zsys"))
//		{
//			//查询待审批列表
//			FkAuditList audit = new FkAuditList();
//			audit.setBusiId(busiId);
//			audit.setModeId(modeId);
//			audit.setDpStatus(1);
//			audit.setStatusList(1);
//			FkAuditList fkAuditList = fkAuditListMapper.selectRefined(audit);
//			if(null == fkAuditList || ("").equals(fkAuditList))
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
//			}
//			
//			String channelType = fkAuditList.getChannelType();
//			//是否为绿色通道
//			if(!channelType.equals("50"))
//			{
//				return;
//			}
//		}
//		
//		//电审一审
//		if(modeId.equals("M_dscs"))
//		{
//			//查询待审批列表
//			FkAuditList audit = new FkAuditList();
//			audit.setBusiId(busiId);
//			audit.setModeId(modeId);
//			audit.setDpStatus(1);
//			audit.setStatusList(1);
//			FkAuditList fkAuditList = fkAuditListMapper.selectRefined(audit);
//			if(null == fkAuditList || ("").equals(fkAuditList))
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
//			}
//			
//			//配置金额
//			double money = Double.valueOf(SysParamsType.AUTOAUDIT_PHONEONE.getDefaultValue().toString());
//			String paramValue = baseSysParamsService.getValueByCode(SysParamsType.AUTOAUDIT_PHONEONE.getCode());
//			if(StringUtils.isNotBlank(paramValue)) 
//			{
//				money = Double.parseDouble(paramValue);
//			}
//			
//			//数据库金额
//			double price = fkAuditList.getLoanAmount();
//			
//			//当前金额大于配置金额则不自动审核
//			if(price > money)
//			{
//				return;
//			}
//		}
//		
//		//模块名称
//		String auditName = "";
//		//审核状态
//		int busiStatus = 0;
//		//电审状态
//		int phoneStatus = 0;
//		//主审核状态
//		int statusList = 2;
//		//审核主键
//		String dataId = "";
//		//机构编码
//		String orgCode = "";
//		//机构名称
//		String orgName = "";
//		//描述
//		String auditDetail = "自动审核";
//		//描述
//		String auditPostil = "自动审核";
//		
//		//查询业务信息表
//		YwBusiness business = ywBusinessMapper.selectByPrimaryKey(busiId);
//		
//		if(null == business || ("").equals(business))
//		{
//			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"ywBusiness is null");
//		}
//		
//		if(modeId.equals("M_zsys"))
//		{
//			//审核名称
//			auditName = "资审一审";
//			//审核状态
//			busiStatus = 80;
//			
//			//修改业务信息
//			YwBusiness ywBusiness = new YwBusiness();
//			ywBusiness.setId(busiId);
//			ywBusiness.setBusiStatus(busiStatus);
//			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
//			if(updateCount == 0)
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update YwBusiness fail");
//			} 
//			else if(updateCount > 1)
//			{
//				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update YwBusiness fail");
//			}
//			
//			//查询待审批列表
//			FkAuditList audit = new FkAuditList();
//			audit.setBusiId(busiId);
//			audit.setModeId(modeId);
//			audit.setDpStatus(1);
//			audit.setStatusList(1);
//			FkAuditList fkAuditList = fkAuditListMapper.selectRefined(audit);
//			if(null == fkAuditList || ("").equals(fkAuditList))
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
//			}
//			
//			//审批记录数据编号
//			dataId = fkAuditList.getId();
//			
//			//经办部门
//			orgName = fkAuditList.getDepartmentName();
//			
//			//修改审核状态
//			FkAuditList auditList = new FkAuditList();
//			auditList.setId(fkAuditList.getId());
//			auditList.setStatusList(statusList);
//			updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
//			if(updateCount == 0)
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
//			} 
//			else if(updateCount > 1)
//			{
//				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
//			}
//		}
//		//电审一审
//		else if(modeId.equals("M_dscs"))
//		{
//			//审核名称
//			auditName = "电审一审";
//			//电审状态
//			phoneStatus = 30;
//			
//			//修改业务信息
//			YwBusiness ywBusiness = new YwBusiness();
//			ywBusiness.setId(busiId);
//			ywBusiness.setPhoneStatus(phoneStatus);
//			int updateCount = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
//			if(updateCount == 0)
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update YwBusiness fail");
//			} 
//			else if(updateCount > 1)
//			{
//				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update YwBusiness fail");
//			}
//			
//			//查询待审批列表
//			FkAuditList audit = new FkAuditList();
//			audit.setBusiId(busiId);
//			audit.setModeId(modeId);
//			audit.setDpStatus(1);
//			audit.setStatusList(1);
//			FkAuditList fkAuditList = fkAuditListMapper.selectRefined(audit);
//			if(null == fkAuditList || ("").equals(fkAuditList))
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
//			}
//			
//			//审批记录数据编号
//			dataId = fkAuditList.getId();
//			
//			//经办部门
//			orgName = fkAuditList.getDepartmentName();
//			
//			//修改审核状态
//			FkAuditList auditList = new FkAuditList();
//			auditList.setId(fkAuditList.getId());
//			auditList.setStatusList(statusList);
//			updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
//			if(updateCount == 0)
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update FkAuditList fail");
//			} 
//			else if(updateCount > 1)
//			{
//				throw new BaseException(ResultFlagType.MULTI_DATA.getCode().toString(),"update FkAuditList fail");
//			}
//		}
//		
//		//插入审批记录表
//		if(modeId.equals("M_zsys"))
//		{
//			otherAuditInfo.initInsertData(userId, loginName);
//			otherAuditInfo.setDataId(dataId);
//			otherAuditInfo.setAuditName(auditName);
//			otherAuditInfo.setAuditStatusValueType("BusiStatus");
//			otherAuditInfo.setAuditStatusValue(busiStatus);
//			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
//			otherAuditInfo.setAuditDetail(auditDetail);
//			otherAuditInfo.setAuditPostil(auditPostil);
//			otherAuditInfo.setPreAuditStatusType("BusiStatus");
//			otherAuditInfo.setPreAuditStatusValue(business.getBusiStatus());
//			otherAuditInfo.setPreAuditStatus("1");
//			//otherAuditInfo.setOrgCode(orgCode);
//			//otherAuditInfo.setOrgName(orgName);
//			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
//			if(insertCount < 1)
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert otherAuditInfo fail");
//			}
//		}
//		//电审一审
//		else if(modeId.equals("M_dscs"))
//		{
//			otherAuditInfo.initInsertData(userId, loginName);
//			otherAuditInfo.setDataId(dataId);
//			otherAuditInfo.setAuditName(auditName);
//			otherAuditInfo.setAuditStatusValueType("phoneStatus");
//			otherAuditInfo.setAuditStatusValue(phoneStatus);
//			otherAuditInfo.setAuditStatus(String.valueOf(statusList));
//			otherAuditInfo.setAuditDetail(auditDetail);
//			otherAuditInfo.setAuditPostil(auditPostil);
//			otherAuditInfo.setPreAuditStatusType("phoneStatus");
//			otherAuditInfo.setPreAuditStatusValue(business.getPhoneStatus());
//			otherAuditInfo.setPreAuditStatus("1");
//			//otherAuditInfo.setOrgCode(orgCode);
//			//otherAuditInfo.setOrgName(orgName);
//			int insertCount = otherAuditInfoMapper.insert(otherAuditInfo);
//			if(insertCount < 1)
//			{
//				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert otherAuditInfo fail");
//			}
//		}
//		
//		//审核预警通知
//		String customerName = business.getCustomerName();
//		OtherMessageApp otherMessageApp_ = new OtherMessageApp();
//		otherMessageApp_.setModeId(ModeIDType.TC.getCode());
//		otherMessageApp_.setBusiId(business.getId());
//		otherMessageApp_.setDataid(dataId);
//		otherMessageApp_.setTypeMsg("01");
//		otherMessageApp_.setTypeMsgEvent(NewsType.TZ10.getCode());
//		otherMessageApp_.setNotificationBar(customerName + "的"+auditName+"审核通过");
//		otherMessageApp_.setTitle(customerName + "的"+auditName+"审核通过");
//		otherMessageApp_.setContent("通知：" + customerName + "的"+auditName+"审核通过，审核结果：正常");
//		Date now = new Date();
//		otherMessageApp_.setTimeCreate(now);
//		otherMessageApp_.setTimeSend(now);
//		otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
////		String shortMessage_ = "客户" + customerName +"的"+auditName+"审核通过，请登录系统查看详情！";
//		//serviceHelper.saveMsg(otherMessageApp_, business.getCustomerId(), customerName, shortMessage_, currentUser, logger);
//		//审核预警通知
//	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  insertOtherAudit</p>  
	*  <p>Description:  </p>  
	*  @param currentUser
	*  @param otherAuditInfo  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#insertOtherAudit(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.other.dto.OtherAuditInfo)  
	*  @version  V1.0
	*/
	@Override
	public void insertOtherAudit(AbstractSysUser currentUser,OtherAuditInfo otherAuditInfo) 
	{
		
		
		//String userId = currentUser.getName();
		//String loginName = currentUser.getName();
		
		if(null == otherAuditInfo || ("").equals(otherAuditInfo))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"otherAuditInfo is null");
		}
		
		String modeId = otherAuditInfo.getModeId();
		String busiId = otherAuditInfo.getBusiId();
		
		String auditDetail = otherAuditInfo.getAuditDetail();
		String auditPostil = otherAuditInfo.getAuditPostil();
 		
		//查询待审批列表
		FkAuditList fkAuditList = new FkAuditList();
		fkAuditList.setBusiId(busiId);
		fkAuditList.setModeId(modeId);
		fkAuditList.setStatusList(1);
		fkAuditList.setDpStatus(1);
		fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
		if(null == fkAuditList || ("").equals(fkAuditList))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditList is null");
		}
		
		//修改待审批数据
		FkAuditList auditList = new FkAuditList();
		auditList.setId(fkAuditList.getId());
		auditList.setAuditDetail(auditDetail);
		auditList.setAuditPostil(auditPostil);
		int updateCount = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
		if(updateCount < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update auditList fail");
		}
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  diepuYushen</p>  
	*  <p>Description:  </p>  
	*  @param currentUser
	*  @param fkPreAuditInfo  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#diepuYushen(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.fk.dto.FkPreAuditInfo)  
	*  @version  V1.0
	*/
	@Override
	public void diepuYushen(AbstractSysUser currentUser,
			FkPreAuditInfo fkPreAuditInfo) {
		
		
		String userId = currentUser.getId();
		String loginName = currentUser.getName();
		
		//查询预审信息
		FkPreAuditInfo preAuditInfo = new FkPreAuditInfo();
		preAuditInfo.setBusiId(fkPreAuditInfo.getBusiId());
		preAuditInfo.setModeId(fkPreAuditInfo.getModeId());
		preAuditInfo.setDpStatus(1);
		preAuditInfo = fkPreAuditInfoMapper.selectRefined(preAuditInfo);
		
		if(null == preAuditInfo || ("").equals(preAuditInfo))
		{
			fkPreAuditInfo.initInsertData(userId, loginName);
			int count = fkPreAuditInfoMapper.insert(fkPreAuditInfo);
			if(count < 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"insert fkPreAuditInfo fail");
			}
			return;
		}
		
		fkPreAuditInfo.initUpdateData(userId, loginName);
		fkPreAuditInfo.setId(preAuditInfo.getId());
		int count = fkPreAuditInfoMapper.updateByPrimaryKeySelective(fkPreAuditInfo);
		if(count < 1)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update fkPreAuditInfo fail");
		}
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  diepuFengKongShenHeV001</p>  
	*  <p>Description:  </p>  
	*  @param currentUser
	*  @param fkAuditList
	*  @param busiId
	*  @param serverRealPath  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#diepuFengKongShenHeV001(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.fk.dto.FkAuditList, java.lang.String, java.lang.String)  
	*  @version  V1.0
	*/
	@Override
	public void diepuFengKongShenHeV001(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String event,String serverRealPath,FengKongShenHeV001ZiDongExe fengKongShenHeV001ZiDongExe)throws Exception
	{
		
		fengKongShenHeV001ZiDong(currentUser,fkAuditList,otherAuditInfo,event,serverRealPath,fengKongShenHeV001ZiDongExe);
	}
	
	//自动审核
	private void fengKongShenHeV001ZiDong(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String event,String serverRealPath,FengKongShenHeV001ZiDongExe fengKongShenHeV001ZiDongExe)throws Exception
	{
		JsonParser parse =new JsonParser();  
		JsonObject json = (JsonObject) parse.parse(new FileReader(serverRealPath)); 
		JsonArray  array = json.get("result").getAsJsonArray();
		if(null == array || 0 == array.size())
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"读取审核配置文件为空");
		}
		
		if(StringUtils.isBlank(event))
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"执行事件为空");
		}
		
		if(event.equals("pass"))
		{
			eventPass(currentUser,fkAuditList,otherAuditInfo,event,serverRealPath,"手动审核",fengKongShenHeV001ZiDongExe);
			return;
		}
		
		if(event.equals("editback"))
		{
			eventEditBack(currentUser,fkAuditList,otherAuditInfo,serverRealPath,"手动审核");
			return;
		}
		
		if(event.equals("fail"))
		{
			eventFail(currentUser,fkAuditList,otherAuditInfo,serverRealPath,"手动审核");
			return;
		}
		
		if(event.equals("lesspass"))
		{
			eventPass(currentUser,fkAuditList,otherAuditInfo,event,serverRealPath,"手动审核",fengKongShenHeV001ZiDongExe);
			return;
		}
		
		if(event.equals("auditback"))
		{
			eventAuditback(currentUser,fkAuditList,otherAuditInfo,serverRealPath,"手动审核",fengKongShenHeV001ZiDongExe);
			return;
		}
		
		if(event.equals("auditPre"))
		{
			eventAuditPre(currentUser,fkAuditList,otherAuditInfo,serverRealPath,"手动审核");
		}
	}
	
	//保存预审
	private void eventAuditPre(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String serverRealPath,String zdshName)throws Exception
	{
		String userId = currentUser.getId();
		String loginName = currentUser.getName();
		String auditDetail = otherAuditInfo.getAuditDetail();
		String auditPostil = otherAuditInfo.getAuditPostil();
		String fkAuditListId = fkAuditList.getId();
		String busiId = fkAuditList.getBusiId();
		String modeId = fkAuditList.getModeId();
		
		//查询预留表数据
		FkPreAuditInfo fkPreAuditInfo = new FkPreAuditInfo();
		fkPreAuditInfo.setBusiId(busiId);
		fkPreAuditInfo.setModeId(modeId);
		fkPreAuditInfo.setDpStatus(1);
		fkPreAuditInfo = fkPreAuditInfoMapper.selectRefined(fkPreAuditInfo);
		if(null == fkPreAuditInfo)
		{
			fkPreAuditInfo = new FkPreAuditInfo();
			fkPreAuditInfo.setBusiId(busiId);
			fkPreAuditInfo.setModeId(modeId);
			fkPreAuditInfo.initInsertData(userId, loginName);
			fkPreAuditInfo.setBusiId(busiId);
			fkPreAuditInfo.setModeId(modeId);
			fkPreAuditInfo.setIdAuditList(fkAuditListId);
			fkPreAuditInfo.setPreAuditDetail(auditDetail);
			fkPreAuditInfo.setPreAuditPostil(auditPostil);
			fkPreAuditInfo.setRemarks("保存预审-资审一审");
			int count = fkPreAuditInfoMapper.insert(fkPreAuditInfo);
			if(count < 1)
			{
				throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkPreAuditInfoMapper error");
			}
		}
		fkPreAuditInfo.setPreAuditDetail(auditDetail);
		fkPreAuditInfo.setPreAuditPostil(auditPostil);
		int count = fkPreAuditInfoMapper.updateByPrimaryKeySelective(fkPreAuditInfo);
		if(count < 1)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkPreAuditInfoMapper error");
		}
	}
	
	//退回审核
	private void eventAuditback(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String serverRealPath,String zdshName,FengKongShenHeV001ZiDongExe fengKongShenHeV001ZiDongExe)throws Exception
	{
		JsonParser parse =new JsonParser();  
		JsonObject json = (JsonObject) parse.parse(new FileReader(serverRealPath)); 
		JsonArray  array = json.get("result").getAsJsonArray();
		if(null == array || 0 == array.size())
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"读取审核配置文件为空");
		}
		
		String userId = currentUser.getId();
		String loginName = currentUser.getName();
		String busiId = fkAuditList.getBusiId();
		String tmpeModeId = fkAuditList.getModeId();
		String fkAuditListId = fkAuditList.getId();
		String remarks = fkAuditList.getRemarks();
		String auditDetail = otherAuditInfo.getAuditDetail();
		String auditPostil = otherAuditInfo.getAuditPostil();
		String orgCode = otherAuditInfo.getOrgCode();
		String orgName = otherAuditInfo.getOrgName();
		String reasonAuditFalse = otherAuditInfo.getReasonAuditFalse();
		String reasonAuditFalseName = otherAuditInfo.getReasonAuditFalseName();
		
		String[]M = tmpeModeId.split("@@@");
		String modeId = M[0]; //当前的模块编码
		String pmodeId = M[1]; //要退回的模块编码
		
		for(int i=0;i<array.size();i++)
		{
			JsonObject object = array.get(i).getAsJsonObject();
			
			//模块编号
			String resultModeId = object.get("modeId").getAsString();
			//审核名称
			String resultPName = object.get("pName").getAsString();
			
			if(modeId.equals(resultModeId))
			{
				//查询待审批数据
				fkAuditList = fkAuditListMapper.selectByPrimaryKey(fkAuditListId);
				//YwBusiness dbYwBusiness = null;
				
				//过审的条件
				JsonArray  arrayEvent = object.get("event").getAsJsonArray();
				if(null != arrayEvent && arrayEvent.size() > 0)
				{
					for(int j=0;j<arrayEvent.size();j++)
					{
						JsonObject objectEvent = arrayEvent.get(j).getAsJsonObject();
						String event = objectEvent.get("event").getAsString();
						
						if(event.equals("auditback"))
						{
							
							//生成当前的时间
							Date timeAuditFinish = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
							
							String fieldName = objectEvent.get("fieldName").getAsString();
							
							//审批结果状态
							int statusList = 0;
							//审核后的值
							int auditStatusValue = 0;
							//审核前的值
							int preAuditStatusValue = 0;
							//退回的模块名称
							String modeNameAuditback = "没有找到名称";
							
							if(fieldName.equals("statusList"))
							{
								//修改审核的状态
								statusList = objectEvent.get("statusList").getAsInt();
								preAuditStatusValue = fkAuditList.getStatusList();
								preAuditStatusValue = statusList;
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
								
								
								//插入数据
								fkAuditList.initInsertData(userId, loginName);
								fkAuditList.setModeId(pmodeId);
								fkAuditList.setSource(resultPName);
								fkAuditList.setTimeAuditFinish(null);
								fkAuditList.setStatusList(1);
								fkAuditList.setOperatorId("");
								fkAuditList.setOperatorName("");
								fkAuditList.setAuditDetail("");
								fkAuditList.setAuditPostil("");
								count = fkAuditListMapper.insert(fkAuditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							
							//是否是从风控经理总监退回的状态
							boolean returnModeId = false;
							
							//退回的额外处理  知道
							if(null != objectEvent.get("returnAuditbackList") && !("").equals(objectEvent.get("returnAuditbackList")))
							{
								JsonArray  arrayReturnAuditbackList = objectEvent.get("returnAuditbackList").getAsJsonArray();
								if(null != arrayReturnAuditbackList && arrayReturnAuditbackList.size() > 0)
								{
									for(int x=0;x<arrayReturnAuditbackList.size();x++)
									{
										JsonObject objectReturnAuditbackList = arrayReturnAuditbackList.get(x).getAsJsonObject();
										String eventModeId = objectReturnAuditbackList.get("modeId").getAsString();
										
										if(eventModeId.equals(modeId))
										{
											returnModeId = true;
											break;
										}
									}
								}
							}
							
							//是否退回到初审
							boolean returnCsdcsModeId = false;
							
							//额外的退回处理
							if(null != objectEvent.get("returnAuditbackList001") && !("").equals(objectEvent.get("returnAuditbackList001")))
							{
								JsonArray  arrayReturnAuditbackList = objectEvent.get("returnAuditbackList001").getAsJsonArray();
								if(null != arrayReturnAuditbackList && arrayReturnAuditbackList.size() > 0)
								{
									for(int x=0;x<arrayReturnAuditbackList.size();x++)
									{
										JsonObject objectReturnAuditbackList = arrayReturnAuditbackList.get(x).getAsJsonObject();
										String eventModeId = objectReturnAuditbackList.get("modeId").getAsString();
										
										if(eventModeId.equals(pmodeId))
										{
											returnCsdcsModeId = true;
											break;
										}
									}
								}
							}
							
							//是否由电审退回
							boolean returnDsModeId = false;
							
							//额外的退回处理
							if(null != objectEvent.get("returnAuditbackList002") && !("").equals(objectEvent.get("returnAuditbackList002")))
							{
								JsonArray  arrayReturnAuditbackList = objectEvent.get("returnAuditbackList002").getAsJsonArray();
								if(null != arrayReturnAuditbackList && arrayReturnAuditbackList.size() > 0)
								{
									for(int x=0;x<arrayReturnAuditbackList.size();x++)
									{
										JsonObject objectReturnAuditbackList = arrayReturnAuditbackList.get(x).getAsJsonObject();
										String eventModeId = objectReturnAuditbackList.get("modeId").getAsString();
										
										if(eventModeId.equals(modeId))
										{
											returnDsModeId = true;
											break;
										}
									}
								}
							}
							
							
							//修改回退回的状态
							if(null != objectEvent.get("auditbackList") && !("").equals(objectEvent.get("auditbackList")))
							{
								JsonArray  arrayAuditbackList = objectEvent.get("auditbackList").getAsJsonArray();
								if(null != arrayAuditbackList && arrayAuditbackList.size() > 0)
								{
									boolean  modeIdBoolean = false;
									for(int x=0;x<arrayAuditbackList.size();x++)
									{
										JsonObject objectAuditbackList = arrayAuditbackList.get(x).getAsJsonObject();
										String auditbackListModeId = objectAuditbackList.get("modeId").getAsString();
										modeNameAuditback = objectAuditbackList.get("modeName").getAsString();
										if(auditbackListModeId.equals(pmodeId))
										{
											modeIdBoolean = true;
											
											//执行的编号
											String modeNumber = objectAuditbackList.get("modeNumber").getAsString();
											
											//修改BusiStatus
											if(modeNumber.equals("MODE001"))
											{
												int busiStatus = objectAuditbackList.get("BusiStatus").getAsInt();
												YwBusiness business = new YwBusiness();
												business.setId(busiId);
												business.setBusiStatus(busiStatus);
												
												if(returnCsdcsModeId)
												{
													//欠资料状态
													int lessInformationStatus = objectAuditbackList.get("lessInformationStatus").getAsInt();
													business.setLessInformationStatus(lessInformationStatus);
													
													//电审状态
													int phoneStatus = objectAuditbackList.get("PhoneStatus").getAsInt();
													business.setPhoneStatus(phoneStatus);
													
													//绿色通道状态
													int greenChannelStatus = objectAuditbackList.get("greenChannelStatus").getAsInt();
													business.setChannelStatus(greenChannelStatus);
													
													//欠资料过审
													FkAuditList auditList = new FkAuditList();
													auditList.setBusiId(busiId);
													auditList.setModeId(ModeIDType.ZLBQSH.getCode());
													auditList.setStatusList(1);
													auditList.setDpStatus(1);
													fkAuditList.setTimeAuditFinish(timeAuditFinish);
													auditList = fkAuditListMapper.selectRefined(auditList);
													if(null != auditList)
													{
														auditList.setStatusList(4);
														auditList.initUpdateData(userId, loginName);
														int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
														if(count < 1)
														{
															throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
														}
													}
													
													//绿色通道
													auditList = new FkAuditList();
													auditList.setBusiId(busiId);
													auditList.setModeId(ModeIDType.LSTDSH.getCode());
													auditList.setStatusList(1);
													auditList.setDpStatus(1);
													fkAuditList.setTimeAuditFinish(timeAuditFinish);
													auditList = fkAuditListMapper.selectRefined(auditList);
													if(null != auditList)
													{
														auditList.setStatusList(4);
														auditList.initUpdateData(userId, loginName);
														int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
														if(count < 1)
														{
															throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
														}
													}
													
													//电审一审
													auditList = new FkAuditList();
													auditList.setBusiId(busiId);
													auditList.setModeId(ModeIDType.DSCS.getCode());
													auditList.setStatusList(1);
													auditList.setDpStatus(1);
													fkAuditList.setTimeAuditFinish(timeAuditFinish);
													auditList = fkAuditListMapper.selectRefined(auditList);
													if(null != auditList)
													{
														auditList.setStatusList(4);
														auditList.initUpdateData(userId, loginName);
														int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
														if(count < 1)
														{
															throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
														}
													}
													
													
													//资审一审
													auditList = new FkAuditList();
													auditList.setBusiId(busiId);
													auditList.setModeId(ModeIDType.ZSYS.getCode());
													auditList.setStatusList(1);
													auditList.setDpStatus(1);
													fkAuditList.setTimeAuditFinish(timeAuditFinish);
													auditList = fkAuditListMapper.selectRefined(auditList);
													if(null != auditList)
													{
														auditList.setStatusList(4);
														auditList.initUpdateData(userId, loginName);
														int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
														if(count < 1)
														{
															throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
														}
													}
												}
												 
												if(returnDsModeId)
												{
													int phoneStatus = objectAuditbackList.get("PhoneStatus").getAsInt();
													business.setPhoneStatus(phoneStatus);
												}
												
												business.setTimeAuditFinish(timeAuditFinish);
												int count = ywBusinessMapper.updateByPrimaryKeySelective(business);
												if(count < 1)
												{
													throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
												}
												break;
											}
											//修改PhoneStatus BusiStatus
											else if(modeNumber.equals("MODE002"))
											{
												YwBusiness business = new YwBusiness();
												business.setId(busiId);
												
												if(returnCsdcsModeId)
												{
													//欠资料状态
													int lessInformationStatus = objectAuditbackList.get("lessInformationStatus").getAsInt();
													business.setLessInformationStatus(lessInformationStatus);
													
													//电审状态
													int phoneStatus = objectAuditbackList.get("PhoneStatus").getAsInt();
													business.setPhoneStatus(phoneStatus);
													
													//绿色通道状态
													int greenChannelStatus = objectAuditbackList.get("greenChannelStatus").getAsInt();
													business.setChannelStatus(greenChannelStatus);
													
													//欠资料过审
													FkAuditList auditList = new FkAuditList();
													auditList.setBusiId(busiId);
													auditList.setModeId(ModeIDType.ZLBQSH.getCode());
													auditList.setStatusList(1);
													auditList.setDpStatus(1);
													fkAuditList.setTimeAuditFinish(timeAuditFinish);
													auditList = fkAuditListMapper.selectRefined(auditList);
													if(null != auditList)
													{
														auditList.setStatusList(4);
														auditList.initUpdateData(userId, loginName);
														int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
														if(count < 1)
														{
															throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
														}
													}
													
													//绿色通道
													auditList = new FkAuditList();
													auditList.setBusiId(busiId);
													auditList.setModeId(ModeIDType.LSTDSH.getCode());
													auditList.setStatusList(1);
													auditList.setDpStatus(1);
													fkAuditList.setTimeAuditFinish(timeAuditFinish);
													auditList = fkAuditListMapper.selectRefined(auditList);
													if(null != auditList)
													{
														auditList.setStatusList(4);
														auditList.initUpdateData(userId, loginName);
														int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
														if(count < 1)
														{
															throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
														}
													}
												}
												
												//风控经理总监退回
												if(returnModeId)
												{
													int busiStatus = objectAuditbackList.get("BusiStatus").getAsInt();
													business.setBusiStatus(busiStatus);
												}
												
												int phoneStatus = objectAuditbackList.get("PhoneStatus").getAsInt();
												business.setPhoneStatus(phoneStatus);
												business.setTimeAuditFinish(timeAuditFinish);
												int count = ywBusinessMapper.updateByPrimaryKeySelective(business);
												if(count < 1)
												{
													throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
												}
												break;
											}
											break;
										}
									}
									//没有找到退回的节点
									if(!modeIdBoolean)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"没有找到退回的节点，请配置");
									}
								}
							}
							
							//插入审核记录表数据
							OtherAuditInfo auditInfo = new OtherAuditInfo();
							auditInfo.setBusiId(busiId);
							auditInfo.initInsertData(userId, loginName);
							auditInfo.setModeId(resultModeId);
							auditInfo.setDataId(fkAuditList.getId());
							auditInfo.setAuditName(resultPName);
							auditInfo.setAuditStatusValueType(fieldName);
							auditInfo.setAuditStatusValue(auditStatusValue);
							auditInfo.setAuditStatus(String.valueOf(statusList));
							auditInfo.setPreAuditStatusType(fieldName);
							auditInfo.setPreAuditStatusValue(preAuditStatusValue);
							auditInfo.setPreAuditStatus(String.valueOf(fkAuditList.getStatusList()));
							auditInfo.setRemarks(zdshName);
							auditDetail = "退回到"+modeNameAuditback;
							auditPostil = "<p>退回到"+modeNameAuditback+"</p>";
							auditInfo.setAuditDetail(auditDetail);
							auditInfo.setAuditPostil(auditPostil);
							auditInfo.setOrgCode(orgCode);
							auditInfo.setOrgName(orgName);
							auditInfo.setReasonAuditFalse(reasonAuditFalse);
							auditInfo.setReasonAuditFalseName(reasonAuditFalseName);
							auditInfo.setRemarks(remarks);
							int count = otherAuditInfoMapper.insert(auditInfo);
							if(count < 1)
							{
								throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"otherAuditInfoMapper error");
							}
							break;
						}
					}
				}
				
				
				//额外事件
				JsonArray  arrayAdditionalEvent = object.get("additionalEvent").getAsJsonArray();
				if(null != arrayAdditionalEvent && arrayAdditionalEvent.size() > 0)
				{
					for(int x=0;x<arrayAdditionalEvent.size();x++)
					{
						JsonObject objectAdditionalEvent = arrayAdditionalEvent.get(x).getAsJsonObject();
						String AdditionalEventSwitch = objectAdditionalEvent.get("switch").getAsString();
						if(AdditionalEventSwitch.equals("open"))
						{
							//查询业务信息表数据
							//dbYwBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
							//事件编码
							String addEvent = objectAdditionalEvent.get("addEvent").getAsString();
							if(addEvent.equals("notice"))
							{
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								if(switchs.equals("open"))
								{
//									Date date = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
//									
//									//审核事件值
									String typeMsg = objectAdditionalEvent.get("typeMsg").getAsString();
//									String modeIdAddEvent = objectAdditionalEvent.get("modeId").getAsString();
//									String customerName = dbYwBusiness.getCustomerName();
//									OtherMessageApp otherMessageApp_ = new OtherMessageApp();
//									otherMessageApp_.setModeId(modeIdAddEvent);
//									otherMessageApp_.setBusiId(busiId);
//									otherMessageApp_.setDataid(fkAuditList.getId());
//									otherMessageApp_.setTypeMsg("01");
//									otherMessageApp_.setTypeMsgEvent(typeMsg);
//									String title = resultPName;
//									String content = "";
//									String notificationBar = resultPName+"：退回审核，审核人："+loginName+",审核时间："+date+"，具体请看详情！";
//								    content += "审核结果：退回审核/n";
//								    content += "审核批注："+HtmlUtil.filterHtml(auditPostil)+"/n";
//								    //content += "审核详情："+HtmlUtil.filterHtml(auditDetail)+"/n";
//								    
//								    String remark = "";
//								    remark += "审核结果：退回审核，";
//								    //remark += "审核详情："+auditDetail+"，";
//								    //remark += "审核批注："+HtmlUtil.filterHtml(auditPostil)+"，";
//								    
//								    YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
//								    ywBusinessExtras.setBusiId(busiId);
//								    ywBusinessExtras.setTypeExtras("AddGps");
//								    ywBusinessExtras.setDpStatus(1);
//								    ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
//								    if(null != ywBusinessExtras)
//								    {
//								    	 content += "GPS保存值："+ywBusinessExtras.getValueExtras()+"/n";
//								    	 //remark += "GPS保存值："+ywBusinessExtras.getValueExtras()+"，";
//								    }
//								    
//								    ywBusinessExtras = new YwBusinessExtras();
//								    ywBusinessExtras.setBusiId(busiId);
//								    ywBusinessExtras.setTypeExtras("AddGeposit");
//								    ywBusinessExtras.setDpStatus(1);
//								    ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
//								    if(null != ywBusinessExtras)
//								    {
//								    	content += "加收押金值"+ywBusinessExtras.getValueExtras()+"/n";
//								    	//remark += "加收押金值"+ywBusinessExtras.getValueExtras()+"，";
//								    }
//								    
//								    remark += "经办人："+loginName+"，";
//								    remark += "经办时间："+date+"";
//									otherMessageApp_.setRemarks(remark);
//								   
//								    content += "经办人："+loginName+"/n";
//								    content += "经办时间："+date+"/n";
//								    content += "温馨提示：碟普科技祝您生活愉快！/n";
//								    content += "版权：杭州碟普科技有限公司/n";
//								    content += "公司电话：0571-89808971";
//									otherMessageApp_.setTitle("【"+title+"】 客户："+customerName);
//									otherMessageApp_.setContent(content);
//									otherMessageApp_.setNotificationBar(notificationBar);
//									Date now = new Date();
//									otherMessageApp_.setTimeCreate(now);
//									otherMessageApp_.setTimeSend(now);
//									otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
//									String shortMessage_ = "客户" + customerName +"的"+resultPName+"退回审核，请登录系统查看详情！";
//									serviceHelper.saveMsg(otherMessageApp_, dbYwBusiness.getSalesmanId(), customerName, shortMessage_, currentUser, logger);
									
									//调用发送短信推送的接口
									systemService.diepuNewsHandle(currentUser, modeId, typeMsg, busiId, null);
								}
							}
						}
					}
				}
				break;
			}
		}
		
		//调用自动审核
		diepuZdshListDiepu(currentUser,fkAuditList,null,"pass",serverRealPath,"自动审核",fengKongShenHeV001ZiDongExe);
	}
	
	//不过审
	private void eventFail(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String serverRealPath,String zdshName)throws Exception
	{
		JsonParser parse =new JsonParser();  
		JsonObject json = (JsonObject) parse.parse(new FileReader(serverRealPath)); 
		JsonArray  array = json.get("result").getAsJsonArray();
		if(null == array || 0 == array.size())
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"读取审核配置文件为空");
		}
		String userId = currentUser.getId();
		String loginName = currentUser.getName();
		String busiId = fkAuditList.getBusiId();
		String fkAuditListId = fkAuditList.getId();
		String modeId = fkAuditList.getModeId();
		String auditDetail = otherAuditInfo.getAuditDetail();
		String auditPostil = otherAuditInfo.getAuditPostil();
		String orgCode = otherAuditInfo.getOrgCode();
		String orgName = otherAuditInfo.getOrgName();
		String reasonAuditFalse = otherAuditInfo.getReasonAuditFalse();
		String reasonAuditFalseName = otherAuditInfo.getReasonAuditFalseName();
		
		boolean modeIdBoolean = false;
		
		for(int i=0;i<array.size();i++)
		{
			JsonObject object = array.get(i).getAsJsonObject();
			
			//模块编号
			String resultModeId = object.get("modeId").getAsString();
			//审核名称
			String resultPName = object.get("pName").getAsString();
			
			if(modeId.equals(resultModeId))
			{
				modeIdBoolean = true;
				
				//查询待审批数据
				fkAuditList = fkAuditListMapper.selectByPrimaryKey(fkAuditListId);
				YwBusiness dbYwBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
				
				//过审的条件
				JsonArray  arrayEvent = object.get("event").getAsJsonArray();
				if(null != arrayEvent && arrayEvent.size() > 0)
				{
					for(int j=0;j<arrayEvent.size();j++)
					{
						JsonObject objectEvent = arrayEvent.get(j).getAsJsonObject();
						String event = objectEvent.get("event").getAsString();
						if(event.equals("fail"))
						{
							//生成当前的时间
							Date timeAuditFinish = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
							
							String fieldName = objectEvent.get("fieldName").getAsString();
							//审批结果状态
							int statusList = 0;
							//业务主状态
							int busiStatus = 0;
							//审核后的值
							int auditStatusValue = 0;
							//审核前的值
							int preAuditStatusValue = 0;
							//通融状态
							int tongrong_status = 0;
							//绿色通道审核
							int green_channel_status = 0;
							//电审状态
							int phoneStatus = 0;
							
							//修改BusiStatus
							if(fieldName.equals("BusiStatus"))
							{
								busiStatus = objectEvent.get("busiStatus").getAsInt();
								statusList = objectEvent.get("statusList").getAsInt();
								auditStatusValue = busiStatus;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getBusiStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setBusiStatus(busiStatus);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改tongrongStatus
							else if(fieldName.equals("tongrongStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								tongrong_status = objectEvent.get("tongrong_status").getAsInt();
								auditStatusValue = tongrong_status;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getTongrongStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								
								//通融区域经理审核
								if(null != objectEvent.get("busiStatus") && !("").equals(objectEvent.get("busiStatus")))
								{
									busiStatus = objectEvent.get("busiStatus").getAsInt();
									ywBusiness.setBusiStatus(busiStatus);
								}
								
								ywBusiness.setId(busiId);
								ywBusiness.setTongrongStatus(tongrong_status);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改greenChannelStatus
							else if(fieldName.equals("greenChannelStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								green_channel_status = objectEvent.get("green_channel_status").getAsInt();
								auditStatusValue = green_channel_status;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getTongrongStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setChannelStatus(green_channel_status);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改  PhoneStatus
							else if(fieldName.equals("PhoneStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								phoneStatus = objectEvent.get("phoneStatus").getAsInt();
								auditStatusValue = phoneStatus;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getPhoneStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setPhoneStatus(phoneStatus);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							
							//插入审核记录表数据
							OtherAuditInfo auditInfo = new OtherAuditInfo();
							auditInfo.setBusiId(busiId);
							auditInfo.initInsertData(userId, loginName);
							auditInfo.setModeId(resultModeId);
							auditInfo.setDataId(fkAuditList.getId());
							auditInfo.setAuditName(resultPName);
							auditInfo.setAuditStatusValueType(fieldName);
							auditInfo.setAuditStatusValue(auditStatusValue);
							auditInfo.setAuditStatus(String.valueOf(statusList));
							auditInfo.setPreAuditStatusType(fieldName);
							auditInfo.setPreAuditStatusValue(preAuditStatusValue);
							auditInfo.setPreAuditStatus(String.valueOf(fkAuditList.getStatusList()));
							auditInfo.setRemarks(zdshName);
							auditInfo.setAuditDetail(auditDetail);
							auditInfo.setAuditPostil(auditPostil);
							auditInfo.setOrgCode(orgCode);
							auditInfo.setOrgName(orgName);
							auditInfo.setReasonAuditFalse(reasonAuditFalse);
							auditInfo.setReasonAuditFalseName(reasonAuditFalseName);
							int count = otherAuditInfoMapper.insert(auditInfo);
							if(count < 1)
							{
								throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"otherAuditInfoMapper error");
							}
							break;
						}
					}
				}
				
				//额外事件
				JsonArray  arrayAdditionalEvent = object.get("additionalEvent").getAsJsonArray();
				if(null != arrayAdditionalEvent && arrayAdditionalEvent.size() > 0)
				{
					for(int x=0;x<arrayAdditionalEvent.size();x++)
					{
						JsonObject objectAdditionalEvent = arrayAdditionalEvent.get(x).getAsJsonObject();
						String AdditionalEventSwitch = objectAdditionalEvent.get("switch").getAsString();
						if(AdditionalEventSwitch.equals("open"))
						{
							//查询业务信息表数据
							dbYwBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
							//事件编码
							String addEvent = objectAdditionalEvent.get("addEvent").getAsString();
							if(addEvent.equals("notice"))
							{
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								if(switchs.equals("open"))
								{
//									Date date = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
									
									//审核事件值
									String typeMsg = objectAdditionalEvent.get("typeMsg").getAsString();
//									String modeIdAddEvent = objectAdditionalEvent.get("modeId").getAsString();
//									String customerName = dbYwBusiness.getCustomerName();
//									OtherMessageApp otherMessageApp_ = new OtherMessageApp();
//									otherMessageApp_.setModeId(modeIdAddEvent);
//									otherMessageApp_.setBusiId(busiId);
//									otherMessageApp_.setDataid(fkAuditList.getId());
//									otherMessageApp_.setTypeMsg("01");
//									otherMessageApp_.setTypeMsgEvent(typeMsg);
//									String title = resultPName;
//									String content = "";
//									String notificationBar = resultPName+"：审核不过，审核人："+loginName+",审核时间："+date+"，具体请看详情！";
//								    content += "审核结果：不过审/n";
//								    content += "审核批注："+HtmlUtil.filterHtml(auditPostil)+"/n";
//								    //content += "审核详情："+auditDetail+"/n";
//								    
//								    String remarks = "";
//									remarks += "审核结果：不过审，";
//									//remarks += "审核详情："+auditDetail+"，";
//									//remarks += "审核批注："+HtmlUtil.filterHtml(auditPostil)+"，";
//								    
//								    YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
//								    ywBusinessExtras.setBusiId(busiId);
//								    ywBusinessExtras.setTypeExtras("AddGps");
//								    ywBusinessExtras.setDpStatus(1);
//								    ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
//								    if(null != ywBusinessExtras)
//								    {
//								    	 content += "GPS保存值："+ywBusinessExtras.getValueExtras()+"/n";
//								    	 //remarks += "GPS保存值："+ywBusinessExtras.getValueExtras()+"，";
//								    }
//								    
//								    ywBusinessExtras = new YwBusinessExtras();
//								    ywBusinessExtras.setBusiId(busiId);
//								    ywBusinessExtras.setTypeExtras("AddGeposit");
//								    ywBusinessExtras.setDpStatus(1);
//								    ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
//								    if(null != ywBusinessExtras)
//								    {
//								    	content += "加收押金值"+ywBusinessExtras.getValueExtras()+"/n";
//								    	//remarks += "加收押金值"+ywBusinessExtras.getValueExtras()+"，";
//								    }
//								    
//								    remarks += "经办人："+loginName+"，";
//									remarks += "经办时间："+date+"";
//									otherMessageApp_.setRemarks(remarks);
//								    
//								    content += "经办人："+loginName+"/n";
//								    content += "经办时间："+date+"/n";
//								    content += "温馨提示：碟普科技祝您生活愉快！/n";
//								    content += "版权：杭州碟普科技有限公司/n";
//								    content += "公司电话：0571-89808971";
//									otherMessageApp_.setTitle("【"+title+"】 客户："+customerName);
//									otherMessageApp_.setContent(content);
//									otherMessageApp_.setNotificationBar(notificationBar);
//									Date now = new Date();
//									otherMessageApp_.setTimeCreate(now);
//									otherMessageApp_.setTimeSend(now);
//									otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
//									String shortMessage_ = "客户" + customerName +"的"+resultPName+"审核不过，请登录系统查看详情！";
//									serviceHelper.saveMsg(otherMessageApp_, dbYwBusiness.getSalesmanId(), customerName, shortMessage_, currentUser, logger);
									
									//调用发送短信推送的接口
									systemService.diepuNewsHandle(currentUser, modeId, typeMsg, busiId, null);
								}
							}
						}
					}
				}
				break;
			}
		}
		//没有找到可执行的节点
		if(!modeIdBoolean)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"没有找到可执行的节点，请配置");
		}
	}
	
	//退回修改
	private void eventEditBack(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String serverRealPath,String zdshName)throws Exception
	{
		JsonParser parse =new JsonParser();  
		JsonObject json = (JsonObject) parse.parse(new FileReader(serverRealPath)); 
		JsonArray  array = json.get("result").getAsJsonArray();
		if(null == array || 0 == array.size())
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"读取审核配置文件为空");
		}
		String userId = currentUser.getId();
		String loginName = currentUser.getName();
		String busiId = fkAuditList.getBusiId();
		String fkAuditListId = fkAuditList.getId();
		String modeId = fkAuditList.getModeId();
		String auditDetail = otherAuditInfo.getAuditDetail();
		String auditPostil = otherAuditInfo.getAuditPostil();
		String orgCode = otherAuditInfo.getOrgCode();
		String orgName = otherAuditInfo.getOrgName();
		
		boolean modeIdBoolean = false;
		
		for(int i=0;i<array.size();i++)
		{
			JsonObject object = array.get(i).getAsJsonObject();
			
			//模块编号
			String resultModeId = object.get("modeId").getAsString();
			//审核名称
			String resultPName = object.get("pName").getAsString();
			
			if(modeId.equals(resultModeId))
			{
				modeIdBoolean = true;
				
				//查询待审批数据
				fkAuditList = fkAuditListMapper.selectByPrimaryKey(fkAuditListId);
				YwBusiness dbYwBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
				
				//过审的条件
				JsonArray  arrayEvent = object.get("event").getAsJsonArray();
				if(null != arrayEvent && arrayEvent.size() > 0)
				{
					for(int j=0;j<arrayEvent.size();j++)
					{
						JsonObject objectEvent = arrayEvent.get(j).getAsJsonObject();
						String event = objectEvent.get("event").getAsString();
						if(event.equals("editback"))
						{
							//生成当前的时间
							Date timeAuditFinish = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
							
							String fieldName = objectEvent.get("fieldName").getAsString();
							//审批结果状态
							int statusList = 0;
							//业务主状态
							int busiStatus = 0;
							//审核后的值
							int auditStatusValue = 0;
							//审核前的值
							int preAuditStatusValue = 0;
							
							//修改BusiStatus
							if(fieldName.equals("BusiStatus"))
							{
								busiStatus = objectEvent.get("busiStatus").getAsInt();
								statusList = objectEvent.get("statusList").getAsInt();
								auditStatusValue = busiStatus;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getBusiStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setBusiStatus(busiStatus);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							
							//插入审核记录表数据
							OtherAuditInfo auditInfo = new OtherAuditInfo();
							auditInfo.setBusiId(busiId);
							auditInfo.initInsertData(userId, loginName);
							auditInfo.setModeId(resultModeId);
							auditInfo.setDataId(fkAuditList.getId());
							auditInfo.setAuditName(resultPName);
							auditInfo.setAuditStatusValueType(fieldName);
							auditInfo.setAuditStatusValue(auditStatusValue);
							auditInfo.setAuditStatus(String.valueOf(statusList));
							auditInfo.setPreAuditStatusType(fieldName);
							auditInfo.setPreAuditStatusValue(preAuditStatusValue);
							auditInfo.setPreAuditStatus(String.valueOf(fkAuditList.getStatusList()));
							auditInfo.setRemarks(zdshName);
							auditInfo.setAuditDetail(auditDetail);
							auditInfo.setAuditPostil(auditPostil);
							auditInfo.setOrgCode(orgCode);
							auditInfo.setOrgName(orgName);
							int count = otherAuditInfoMapper.insert(auditInfo);
							if(count < 1)
							{
								throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"otherAuditInfoMapper error");
							}
							break;
						}
					}
				}
				
				//额外事件
				JsonArray  arrayAdditionalEvent = object.get("additionalEvent").getAsJsonArray();
				if(null != arrayAdditionalEvent && arrayAdditionalEvent.size() > 0)
				{
					if(null != arrayAdditionalEvent && arrayAdditionalEvent.size() > 0)
					{
						for(int x=0;x<arrayAdditionalEvent.size();x++)
						{
							JsonObject objectAdditionalEvent = arrayAdditionalEvent.get(x).getAsJsonObject();
							String AdditionalEventSwitch = objectAdditionalEvent.get("switch").getAsString();
							if(AdditionalEventSwitch.equals("open"))
							{
								String addEvent = objectAdditionalEvent.get("addEvent").getAsString();
								
								//修改二手车过户状态
								if(addEvent.equals("statusTransfer"))
								{
									YwTransfer ywTransfer = new YwTransfer();
									ywTransfer.setBusiId(busiId);
									ywTransfer.setDpStatus(1);
									ywTransfer = ywTransferMapper.selectRefined(ywTransfer);
									
									if(null == ywTransfer)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywTransfer is null");
									}
									
									ywTransfer.setStatusTransfer(20);
									int count = ywTransferMapper.updateByPrimaryKeySelective(ywTransfer);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywTransferMapper update error");
									}
								}
							}
						}
					}
				}
				break;
			}
		}
		//没有找到可执行的节点
		if(!modeIdBoolean)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"没有找到可执行的节点，请配置");
		}
	}
	
	//过审
	private void eventPass(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String passEvent,String serverRealPath,String zdshName,FengKongShenHeV001ZiDongExe fengKongShenHeV001ZiDongExe)throws Exception
	{
		JsonParser parse =new JsonParser();  
		JsonObject json = (JsonObject) parse.parse(new FileReader(serverRealPath)); 
		JsonArray  array = json.get("result").getAsJsonArray();
		if(null == array || 0 == array.size())
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"读取审核配置文件为空");
		}
		
		String userId = currentUser.getId();
		String loginName = currentUser.getName();
		String busiId = fkAuditList.getBusiId();
		String fkAuditListId = fkAuditList.getId();
		String modeId = fkAuditList.getModeId();
		String auditDetail = null;
		String auditPostil = null;
		String orgCode = null;
		String orgName = null;
		if(null != otherAuditInfo)
		{
			auditDetail = otherAuditInfo.getAuditDetail();
		    auditPostil = otherAuditInfo.getAuditPostil();
			orgCode = otherAuditInfo.getOrgCode();
			orgName = otherAuditInfo.getOrgName();
		}
		
		boolean modeIdBoolean = false;
		
		for(int i=0;i<array.size();i++)
		{
			JsonObject object = array.get(i).getAsJsonObject();
			
			//模块编号
			String resultModeId = object.get("modeId").getAsString();
			//审核名称
			String resultPName = object.get("pName").getAsString();
			
			if(modeId.equals(resultModeId))
			{
				modeIdBoolean = true;
				
				//查询待审批数据
				fkAuditList = fkAuditListMapper.selectByPrimaryKey(fkAuditListId);
				YwBusiness dbYwBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
				
				//过审的条件
				JsonArray  arrayEvent = object.get("event").getAsJsonArray();
				if(null != arrayEvent && arrayEvent.size() > 0)
				{
					for(int j=0;j<arrayEvent.size();j++)
					{
						JsonObject objectEvent = arrayEvent.get(j).getAsJsonObject();
						String event = objectEvent.get("event").getAsString();
						if(event.equals(passEvent))
						{
							//生成当前的时间
							Date timeAuditFinish = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
							
							String fieldName = objectEvent.get("fieldName").getAsString();
							//审批结果状态
							int statusList = 0;
							//业务主状态
							int busiStatus = 0;
							//审核后的值
							int auditStatusValue = 0;
							//审核前的值
							int preAuditStatusValue = 0;
							//电审状态
							int phoneStatus = 0;
							//欠资料状态
							int lessInformationStatus = 0;
							//通融审批状态
							int tongrong_status = 0;
							//绿色通道审核
							int green_channel_status = 0;
							//额外状态1
							int added_status1 = 0;
							//退押金状态
							int refundDepositStatus = 0;
							//代偿稽核审核状态
							int insteadPaymentStatus = 0;
							//新车提车
							int pickCarStatus = 0;
							//垫款调整B审核
							int remit_adjust_status = 0;
							//鑫合汇业务状态
							int thirdBusiStatus = 0;
							
							//修改BusiStatus
							if(fieldName.equals("BusiStatus"))
							{
								busiStatus = objectEvent.get("busiStatus").getAsInt();
								statusList = objectEvent.get("statusList").getAsInt();
								auditStatusValue = busiStatus;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getBusiStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setBusiStatus(busiStatus);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改PhoneStatus
							else if(fieldName.equals("PhoneStatus"))
							{
								phoneStatus = objectEvent.get("phoneStatus").getAsInt();
								statusList = objectEvent.get("statusList").getAsInt();
								auditStatusValue = phoneStatus;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getPhoneStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setPhoneStatus(phoneStatus);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改 LessInformationStatus && busiStatus
							else if(fieldName.equals("LessInformationStatus"))
							{
								busiStatus = objectEvent.get("busiStatus").getAsInt();
								statusList = objectEvent.get("statusList").getAsInt();
								lessInformationStatus = objectEvent.get("lessInformationStatus").getAsInt();
								auditStatusValue = busiStatus;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getBusiStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setBusiStatus(busiStatus);
								ywBusiness.setLessInformationStatus(lessInformationStatus);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改tongrongStatus
							else if(fieldName.equals("tongrongStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								tongrong_status = objectEvent.get("tongrong_status").getAsInt();
								auditStatusValue = tongrong_status;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getTongrongStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setTongrongStatus(tongrong_status);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改greenChannelStatus
							else if(fieldName.equals("greenChannelStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								green_channel_status = objectEvent.get("green_channel_status").getAsInt();
								auditStatusValue = green_channel_status;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getTongrongStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setChannelStatus(green_channel_status);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改 addedStatus1
							else if(fieldName.equals("addedStatus1"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								added_status1 = objectEvent.get("added_status1").getAsInt();
								auditStatusValue = added_status1;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getTongrongStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setAddedStatus1(added_status1);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改passLessInformationStatus
							if(fieldName.equals("passLessInformationStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								lessInformationStatus = objectEvent.get("lessInformationStatus").getAsInt();
								auditStatusValue = lessInformationStatus;
								
								//查询业务信息表数据
								preAuditStatusValue = dbYwBusiness.getTongrongStatus();
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setLessInformationStatus(lessInformationStatus);
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改 RefundDepositStatus
							if(fieldName.equals("RefundDepositStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								refundDepositStatus = objectEvent.get("refundDepositStatus").getAsInt();
								auditStatusValue = refundDepositStatus;
								
								//查询退押金表
								DhDepositMoney dhDepositMoney = new DhDepositMoney();
								dhDepositMoney.setBusiId(busiId);
								dhDepositMoney.setDpStatus(1);
								dhDepositMoney = dhDepositMoneyMapper.selectRefined(dhDepositMoney);
								
								if(null == dhDepositMoney)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dhDepositMoney is null");
								}
								
								//退押金表数据
								preAuditStatusValue = dhDepositMoney.getStatusRefundDeposit();
								
								//修改退押金表数据
								dhDepositMoney.setStatusRefundDeposit(refundDepositStatus);
								int count = dhDepositMoneyMapper.updateByPrimaryKeySelective(dhDepositMoney);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dhDepositMoneyMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改InsteadPaymentStatus
							else if(fieldName.equals("InsteadPaymentStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								insteadPaymentStatus = objectEvent.get("insteadPaymentStatus").getAsInt();
								auditStatusValue = insteadPaymentStatus;
								
								//查询垫资表数据
								DhInsteadPayment dhInsteadPayment = new DhInsteadPayment();
								dhInsteadPayment.setBusiId(busiId);
								dhInsteadPayment.setDpStatus(1);
								dhInsteadPayment = dhInsteadPaymentMapper.selectRefined(dhInsteadPayment);
								if(null == dhInsteadPayment)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dhInsteadPaymentMapper is null");
								}
								
								//改垫资状态
								preAuditStatusValue = dhInsteadPayment.getStatusInstead();
								
								//修改垫资
								dhInsteadPayment.setStatusInstead(insteadPaymentStatus);
								int count = dhInsteadPaymentMapper.updateByPrimaryKeySelective(dhInsteadPayment);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dhInsteadPaymentMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改PickCarStatus
							else if(fieldName.equals("PickCarStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								pickCarStatus = objectEvent.get("pickCarStatus").getAsInt();
								busiStatus = objectEvent.get("busiStatus").getAsInt();
								auditStatusValue = pickCarStatus;
								
								//查询新车提车
								DzPickCar dzPickCar = new DzPickCar();
								dzPickCar.setBusiId(busiId);
								dzPickCar.setDpStatus(1);
								dzPickCar = dzPickCarMapper.selectRefined(dzPickCar);
								if(null == dzPickCar)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dzPickCar is null");
								}
								
								//新车提车
								preAuditStatusValue = dzPickCar.getPickCarStatus();
								
								
								//修改业务信息表数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setBusiStatus(busiStatus);
								ywBusiness.setPickCarTime(dzPickCar.getPickCarTime());
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
								}
								
								//修改新车提车状态
								dzPickCar.setPickCarStatus(pickCarStatus);
								count = dzPickCarMapper.updateByPrimaryKeySelective(dzPickCar);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dzPickCarMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改remitAdjustStatus
							else if(fieldName.equals("remitAdjustStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								remit_adjust_status = objectEvent.get("remit_adjust_status").getAsInt();
								auditStatusValue = remit_adjust_status;
								
								CwRemitAdjustB cwRemitAdjustB = new CwRemitAdjustB();
								cwRemitAdjustB.setBusiId(busiId);
								cwRemitAdjustB.setDpStatus(1);
								cwRemitAdjustB = cwRemitAdjustBMapper.selectRefined(cwRemitAdjustB);
								if(null == cwRemitAdjustB)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"cwRemitAdjustB is null");
								}
								
								//垫款调整
								preAuditStatusValue = cwRemitAdjustB.getRemitAdjustStatus();
								
								//修改
								cwRemitAdjustB.setRemitAdjustStatus(remit_adjust_status);
								int count = cwRemitAdjustBMapper.updateByPrimaryKeySelective(cwRemitAdjustB);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"cwRemitAdjustBMapper error");
								}
								
								//修改审核列表数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditList.getId());
								auditList.setStatusList(statusList);
								auditList.setTimeAuditFinish(timeAuditFinish);
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
								}
							}
							//修改财务审核一
							else if(fieldName.equals("cwshyAddedStatus1"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								added_status1 = objectEvent.get("addedStatus1").getAsInt();
								auditStatusValue = added_status1;
								
								//大额审批金额  系统参数表
								
								String sqlXmls = "select t.id,t.value_param from base_sys_params t where t.code_param = 'LargeInsteadPayment' limit 1";
								Map<String, String> maps = publicDao.selectMapsSql(sqlXmls);
								double money = 0;
								if(null != maps && StringUtils.isNotBlank(maps.get("value_param"))) 
								{
									money = Double.parseDouble(maps.get("value_param"));
								}
								
								
								//修改审核列表值
								FkAuditList auditList = new FkAuditList();
								auditList.setStatusList(statusList);
								auditList.setId(fkAuditListId);
								int count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper update error");
								}
								
								//如果当前的金额大于  系统参数大额审批  则插入大额审批数据，否则则改状态为打款中 320
								if(fkAuditList.getLoanAmount() > money)
								{
									//大额状态
									added_status1 = 150;
									auditStatusValue = added_status1;
									
									//插入大额审批记录  M_dedksp
									fkAuditList.initInsertData(userId, loginName);
									fkAuditList.setStatusList(1);
									fkAuditList.setModeId("M_dedksp");
									fkAuditList.setSource(resultPName);
									fkAuditList.setOperatorId("");
									fkAuditList.setOperatorName("");
									fkAuditList.setAuditDetail("");
									fkAuditList.setAuditPostil("");
									count = fkAuditListMapper.insert(fkAuditList);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"insert fkAuditList fail");
									} 
									

									//修改业务状态
									YwBusiness ywBusiness = new YwBusiness();
									ywBusiness.setId(busiId);
									ywBusiness.setAddedStatus1(added_status1);
									count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusinessMapper fail");
									} 
								}
								else 
								{
									//修改业务状态
									YwBusiness ywBusiness = new YwBusiness();
									ywBusiness.setId(busiId);
									ywBusiness.setAddedStatus1(added_status1);
									count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"update ywBusinessMapper fail");
									} 
								}
							}
							//修改thirdBusiStatus  鑫合汇
							else if(fieldName.equals("thirdBusiStatus"))
							{
								statusList = objectEvent.get("statusList").getAsInt();
								thirdBusiStatus = objectEvent.get("thirdBusiStatus").getAsInt();
								auditStatusValue = thirdBusiStatus;
								
								//修改业务信息数据
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setThirdBusiStatus(thirdBusiStatus);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper update error");
								}
								//修改鑫合汇状态
								String sqlXmls = "update th_yw_business t set t.third_busi_status = '"+thirdBusiStatus+"' where t.busi_id = '"+busiId+"' and t.dp_status = 1";
								count = publicDao.updateWhereSqlXmls(sqlXmls);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),sqlXmls);
								}
								
								//修改审核数据
								FkAuditList auditList = new FkAuditList();
								auditList.initUpdateData(userId, loginName);
								auditList.setId(fkAuditListId);
								auditList.setStatusList(statusList);  
								count = fkAuditListMapper.updateByPrimaryKeySelective(auditList);
								if(count < 1)
								{  
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper update error");
								}
							}
							
							//插入审核记录表数据
							OtherAuditInfo auditInfo = new OtherAuditInfo();
							auditInfo.setBusiId(busiId);
							auditInfo.initInsertData(userId, loginName);
							auditInfo.setModeId(resultModeId);
							auditInfo.setDataId(fkAuditList.getId());
							auditInfo.setAuditName(resultPName);
							auditInfo.setAuditStatusValueType(fieldName);
							auditInfo.setAuditStatusValue(auditStatusValue);
							auditInfo.setAuditStatus(String.valueOf(statusList));
							auditInfo.setPreAuditStatusType(fieldName);
							auditInfo.setPreAuditStatusValue(preAuditStatusValue);
							auditInfo.setPreAuditStatus(String.valueOf(fkAuditList.getStatusList()));
							auditInfo.setAuditDetail(auditDetail);
							auditInfo.setAuditPostil(auditPostil);
							auditInfo.setRemarks(zdshName);
							
							if(StringUtils.isNotBlank(zdshName))
							{
								if(zdshName.equals("手动审核"))
								{
									auditInfo.setOrgCode(orgCode);
									auditInfo.setOrgName(orgName);
								}
								else if(zdshName.equals("自动审核"))
								{
									auditInfo.setOrgCode("自动审核");
									auditInfo.setOrgName("自动审核");
									auditInfo.setCreator("00000000000000000000000000000000");
									auditInfo.setCreatorName("自动审核");
								}
							}
							else
							{
								auditInfo.setAuditDetail("自动审核");
								auditInfo.setAuditPostil("自动审核");
								auditInfo.setOrgCode("自动审核");
								auditInfo.setOrgName("自动审核");
								auditInfo.setCreator("00000000000000000000000000000000");
								auditInfo.setCreatorName("自动审核");
							}
							int count = otherAuditInfoMapper.insert(auditInfo);
							if(count < 1)
							{
								throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"otherAuditInfoMapper error");
							}
							break;
						}
					}
				}
				
				//需要插入的数据
				JsonArray  arrayGenerate = object.get("generate").getAsJsonArray();
				if(null != arrayGenerate && arrayGenerate.size() > 0)
				{
					for(int x=0;x<arrayGenerate.size();x++)
					{
						JsonObject objectGenerate = arrayGenerate.get(x).getAsJsonObject();
						String generateModeId = objectGenerate.get("modeId").getAsString();
						fkAuditList.initInsertData(userId, loginName);
						fkAuditList.setModeId(generateModeId);
						fkAuditList.setSource(resultPName);
						fkAuditList.setStatusList(1);
						fkAuditList.setTimeAuditFinish(null);
						fkAuditList.setAuditDetail("");
						fkAuditList.setAuditPostil("");
						fkAuditList.setOperatorId("");
						fkAuditList.setOperatorName("");
						int count = fkAuditListMapper.insert(fkAuditList);
						if(count < 1)
						{
							throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
						}
						
						//自动审核判断条件    如果是外部调用审核   就直接调用这个就可以了  
						if(null == otherAuditInfo)
						{
							otherAuditInfo = new OtherAuditInfo();
							otherAuditInfo.setAuditDetail("自动审核");
							otherAuditInfo.setAuditPostil("自动审核");
						}
						diepuZdshListDiepu(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,"自动审核",fengKongShenHeV001ZiDongExe);
					}
				}
				
				//额外事件
				JsonArray  arrayAdditionalEvent = object.get("additionalEvent").getAsJsonArray();
				if(null != arrayAdditionalEvent && arrayAdditionalEvent.size() > 0)
				{
					for(int x=0;x<arrayAdditionalEvent.size();x++)
					{
						JsonObject objectAdditionalEvent = arrayAdditionalEvent.get(x).getAsJsonObject();
						String AdditionalEventSwitch = objectAdditionalEvent.get("switch").getAsString();
						if(AdditionalEventSwitch.equals("open"))
						{
							//生成当前的时间
							Date timeAuditFinish = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
							
							//查询业务信息表数据
							dbYwBusiness = ywBusinessMapper.selectByPrimaryKey(busiId);
							
							//事件编码
							String addEvent = objectAdditionalEvent.get("addEvent").getAsString();
							
							if(null == addEvent || ("").equals(addEvent))
							{
								throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"addEvent 事件  配置 为空");
							}
							
							//风控经理插入事件
							if(addEvent.equals("insertFkjlsh"))
							{
								//资审状态
								int busiStatus = dbYwBusiness.getBusiStatus();
								//电审状态
								int phoneStauts = dbYwBusiness.getPhoneStatus();
								
								//如果是风控经理退回到电审的时候  busiStatus 就不是85了   则需要改成  >= 85 的状态
								if(busiStatus >= 85 && phoneStauts == 40)
								{
									YwBusiness business = new YwBusiness();
									business.setId(busiId);
									business.setBusiStatus(90);
									business.setTimeAuditFinish(timeAuditFinish);
									int count = ywBusinessMapper.updateByPrimaryKeySelective(business);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper error");
									}
									
									//插入风控经理审核数据
									if(business.getBusiStatus() == 90)
									{
										fkAuditList.initInsertData(userId, loginName);
										fkAuditList.setModeId(ModeIDType.FKJLSH.getCode());
										fkAuditList.setSource(resultPName);
										fkAuditList.setStatusList(1);
										fkAuditList.setAuditDetail("");
										fkAuditList.setAuditPostil("");
										fkAuditList.setTimeAuditFinish(null);
										fkAuditList.setOperatorId("");
										fkAuditList.setOperatorName("");
										count = fkAuditListMapper.insert(fkAuditList);
										if(count < 1)
										{
											throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
										}
									}
									
									//自动审核判断条件    如果是外部调用审核   就直接调用这个就可以了  
									diepuZdshListDiepu(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,"自动审核",fengKongShenHeV001ZiDongExe);
								}
							}
							
							//绿色通道审核插入事件
							if(addEvent.equals("insertLstdsh"))
							{
								//判断是否为绿色通道
								if(dbYwBusiness.getChannelType().equals("50"))
								{
									//插入风控经理审核数据
									fkAuditList.initInsertData(userId, loginName);
									fkAuditList.setModeId(ModeIDType.LSTDSH.getCode());
									fkAuditList.setSource(resultPName);
									fkAuditList.setStatusList(1);
									fkAuditList.setTimeAuditFinish(null);
									fkAuditList.setOperatorId("");
									fkAuditList.setOperatorName("");
									fkAuditList.setAuditDetail("");
									fkAuditList.setAuditPostil("");
									int count = fkAuditListMapper.insert(fkAuditList);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
									}
								}
							}
							
							//审核通知事件
							if(addEvent.equals("notice"))
							{
//								Date date = ZhppDateUtil.strToTimestamp(DateUtil.dateToFormat(new Date(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss");
								
								//开关
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								
								if(switchs.equals("open"))
								{
									//审核事件值
									String typeMsg = objectAdditionalEvent.get("typeMsg").getAsString();
//									String modeIdAddEvent = objectAdditionalEvent.get("modeId").getAsString();
//									String customerName = dbYwBusiness.getCustomerName();
//									OtherMessageApp otherMessageApp_ = new OtherMessageApp();
//									otherMessageApp_.setModeId(modeIdAddEvent);
//									otherMessageApp_.setBusiId(busiId);
//									otherMessageApp_.setDataid(fkAuditList.getId());
//									otherMessageApp_.setTypeMsg("01");
//									otherMessageApp_.setTypeMsgEvent(typeMsg);
//									String title = resultPName;
//									String content = "";
//									String notificationBar = resultPName+"：审核成功，审核人："+loginName+",审核时间："+date+"，具体请看详情！";
//								    content += "审核结果：通过/n";
//								    content += "审核批注："+HtmlUtil.filterHtml(auditPostil)+"/n";
////								    content += "审核详情："+auditDetail+"/n";
//								    
//								    String remarks = "";
//									remarks += "审核结果：通过，";
////									remarks += "审核详情："+auditDetail+"，";
////									remarks += "审核批注："+HtmlUtil.filterHtml(auditPostil)+"，";
//								    
//								    YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
//								    ywBusinessExtras.setBusiId(busiId);
//								    ywBusinessExtras.setTypeExtras("AddGps");
//								    ywBusinessExtras.setDpStatus(1);
//								    ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
//								    if(null != ywBusinessExtras)
//								    {
//								    	 content += "GPS保存值："+ywBusinessExtras.getValueExtras()+"/n";
////								    	 remarks += "GPS保存值："+ywBusinessExtras.getValueExtras()+"，";
//								    }
//								    
//								    ywBusinessExtras = new YwBusinessExtras();
//								    ywBusinessExtras.setBusiId(busiId);
//								    ywBusinessExtras.setTypeExtras("AddGeposit");
//								    ywBusinessExtras.setDpStatus(1);
//								    ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
//								    if(null != ywBusinessExtras)
//								    {
//								    	content += "加收押金值"+ywBusinessExtras.getValueExtras()+"/n";
////								    	remarks += "加收押金值"+ywBusinessExtras.getValueExtras()+"，";
//								    }
//								    
//								    remarks += "经办人："+loginName+"，";
//									remarks += "经办时间："+date+"";
//									otherMessageApp_.setRemarks(remarks);
//								    
//								    content += "经办人："+loginName+"/n";
//								    content += "经办时间："+date+"/n";
//								    content += "温馨提示：碟普科技祝您生活愉快！/n";
//								    content += "版权：杭州碟普科技有限公司/n";
//								    content += "公司电话：0571-89808971";
//									otherMessageApp_.setTitle("【"+title+"】 客户："+customerName);
//									otherMessageApp_.setContent(content);
//									otherMessageApp_.setNotificationBar(notificationBar);
//									Date now = new Date();
//									otherMessageApp_.setTimeCreate(now);
//									otherMessageApp_.setTimeSend(now);
//									otherMessageApp_.setStatusMsg(MessageStatus.WEI_TUI_SONG.getCode());
//									String shortMessage_ = "客户" + customerName +"的"+resultPName+"审核成功，请登录系统查看详情！";
//									serviceHelper.saveMsg(otherMessageApp_, dbYwBusiness.getSalesmanId(), customerName, shortMessage_, currentUser, logger);
									
									//调用发送消息接口
									systemService.diepuNewsHandle(currentUser, modeId, typeMsg, busiId, null);
									
									//额外事件
									systemService.diepuNewsHandleExtra(currentUser, busiId);
								}
							}
							
							//如果是二手车则修改主状态 事件
							if(addEvent.equals("carTypeBusiStatus"))
							{
								String car_type = dbYwBusiness.getCarType();
								if(null != car_type && car_type.equals("02"))
								{
									YwBusiness business = new YwBusiness();
									business.setId(busiId);
									business.setBusiStatus(200);
									business.setTimeAuditFinish(timeAuditFinish);
									int count = ywBusinessMapper.updateByPrimaryKeySelective(business);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update ywBusinessMapper fail");
									}
								}
							}
							
							//垫款调整B审核调整 审核事件
							if(addEvent.equals("DZTZBSH001"))
							{
								//查询调整字表
								CwRemitAdjustbSub cwRemitAdjustbSub = new CwRemitAdjustbSub();
								cwRemitAdjustbSub.setBusiId(busiId);
								cwRemitAdjustbSub.setDpStatus(1);
								cwRemitAdjustbSub = cwRemitAdjustbSubMapper.selectRefined(cwRemitAdjustbSub);
								if(null == cwRemitAdjustbSub)
								{
									throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"cwRemitAdjustbSubMapper is null");
								}
								
								if(null == cwRemitAdjustbSub.getLoanAmountNew())
								{
									throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"cwRemitAdjustbSub.getLoanAmountNew() is null");
								}
								
								//修改业务信息表
								YwBusiness business = new YwBusiness();
								business.setId(busiId);
								business.setRealLoanAmount(cwRemitAdjustbSub.getLoanAmountNew());
								business.setTimeAuditFinish(timeAuditFinish);
								business.setRealLoanAmount(cwRemitAdjustbSub.getLoanAmountNew());
								business.setSignLoanAmount(cwRemitAdjustbSub.getSignLoanAmountNew());
								int count = ywBusinessMapper.updateByPrimaryKeySelective(business);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update ywBusinessMapper fail");
								}
								
								//贷款信息
								YwBusinessLoan ywBusinessLoan = new YwBusinessLoan();
								ywBusinessLoan.setBusiId(busiId);
								ywBusinessLoan.setDpStatus(1);
								ywBusinessLoan = ywBusinessLoanMapper.selectRefined(ywBusinessLoan);
								if(null == ywBusinessLoan)
								{
									throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"ywBusinessLoanMapper is null");
								}
								
								ywBusinessLoan.setLoanAmount(cwRemitAdjustbSub.getLoanAmountNew());
								ywBusinessLoan.setFirstPaymentAmount(cwRemitAdjustbSub.getFirstPaymentAmountNew());
								ywBusinessLoan.setSignFirstPaymentAmount(cwRemitAdjustbSub.getSignFirstPaymentAmountNew());
								ywBusinessLoan.setSignLoanAmount(cwRemitAdjustbSub.getSignLoanAmountNew());
								ywBusinessLoan.setAmountMonthly(cwRemitAdjustbSub.getAmountMonthlyNew());
								ywBusinessLoan.setTotalRepaymentAmount(cwRemitAdjustbSub.getTotalRepaymentAmountNew());
								ywBusinessLoan.setTotalRepaymentProportion(cwRemitAdjustbSub.getTotalRepaymentProportionNew());
								ywBusinessLoan.setMonthlyPrincipalAmount(cwRemitAdjustbSub.getMonthlyPrincipalAmountNew());
								ywBusinessLoan.setMonthlyFee(cwRemitAdjustbSub.getMonthlyFee2New());
								ywBusinessLoan.setFirstMonthFee2(cwRemitAdjustbSub.getFirstMonthFee2New());
								ywBusinessLoan.setFirstMonthAmount(cwRemitAdjustbSub.getFirstMonthAmountNew());
								ywBusinessLoan.setFirstMonthFee(cwRemitAdjustbSub.getFirstMonthFeeNew());
								ywBusinessLoan.setFirstMonthFee2(cwRemitAdjustbSub.getFirstMonthFee2New());
								ywBusinessLoan.setFirstMonthTotalAmount(cwRemitAdjustbSub.getFirstMonthTotalAmountNew());
								ywBusinessLoan.setStagesFee(cwRemitAdjustbSub.getStagesFee2New());
								ywBusinessLoan.setStagesFee2(cwRemitAdjustbSub.getStagesFee2New());
								if(null != cwRemitAdjustbSub.getServicePriceNew())
								{
									ywBusinessLoan.setServicePrice(cwRemitAdjustbSub.getServicePriceNew());
								}
								ywBusinessLoan.setCarPrice(cwRemitAdjustbSub.getCarPriceNew());
								ywBusinessLoan.setCarEstimatePrice(cwRemitAdjustbSub.getCarEstimatePriceNew());
								count = ywBusinessLoanMapper.updateByPrimaryKeySelective(ywBusinessLoan);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update ywBusinessLoanMapper fail");
								}
								
								//查询按揭日报表
								YwFees ywFees = new YwFees();
								ywFees.setBusiId(busiId);
								ywFees.setDpStatus(1);
								ywFees = ywFeesMapper.selectRefined(ywFees);
								if(null == ywFees)
								{
									throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"ywFeesMapper is null");
								}
								
								//修改按揭日报表
								ywFees.setRebateDealer(cwRemitAdjustbSub.getRebateDealerNew());
								ywFees.setRebateProvince(cwRemitAdjustbSub.getRebateProvinceNew());
								ywFees.setRebateArea(cwRemitAdjustbSub.getRebateAreaNew());
								count = ywFeesMapper.updateByPrimaryKeySelective(ywFees);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"update ywFeesMapper fail");
								}
							}
							
							//通融审核二插入不过审的待审批列表数据
							if(addEvent.equals("trshInsertDsp"))
							{
								JsonArray  arrayObjectAdditionalEvent = objectAdditionalEvent.get("returnStutsArray").getAsJsonArray();
								if(null != arrayObjectAdditionalEvent && arrayObjectAdditionalEvent.size() > 0)
								{
									for(int g=0;g<arrayObjectAdditionalEvent.size();g++)
									{
										JsonObject objectArrayObjectAdditionalEvent = arrayObjectAdditionalEvent.get(g).getAsJsonObject();
										//当前模块编号
										String trshInsertDspModeId = objectArrayObjectAdditionalEvent.get("modeId").getAsString();
										//当前的可严重类型
										String trshInsertDspFkshType = objectArrayObjectAdditionalEvent.get("fkshType").getAsString();
										
										//类型判断
										if(trshInsertDspFkshType.equals("FKSHX001"))
										{
											//当前执行的主状态
											int trshInsertDspBusiStatus = objectArrayObjectAdditionalEvent.get("busiStatus").getAsInt();
											
											if(dbYwBusiness.getBusiStatus() == trshInsertDspBusiStatus)
											{
												//插入待审批列表
												fkAuditList.initInsertData(userId, loginName);
												fkAuditList.setModeId(trshInsertDspModeId);
												fkAuditList.setSource(resultPName);
												fkAuditList.setStatusList(1);
												fkAuditList.setTimeAuditFinish(null);
												fkAuditList.setOperatorId("");
												fkAuditList.setOperatorName("");
												int count = fkAuditListMapper.insert(fkAuditList);
												if(count < 1)
												{
													throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
												}
											}
										}
										
										if(trshInsertDspFkshType.equals("FKSHX002"))
										{
											//当前执行的电审状态
											int trshInsertDspPhoneStatus = objectArrayObjectAdditionalEvent.get("PhoneStatus").getAsInt();
											
											if(dbYwBusiness.getPhoneStatus() == trshInsertDspPhoneStatus)
											{
												//插入待审批列表
												fkAuditList.initInsertData(userId, loginName);
												fkAuditList.setModeId(trshInsertDspModeId);
												fkAuditList.setSource(resultPName);
												fkAuditList.setStatusList(1);
												fkAuditList.setTimeAuditFinish(null);
												fkAuditList.setOperatorId("");
												fkAuditList.setOperatorName("");
												int count = fkAuditListMapper.insert(fkAuditList);
												if(count < 1)
												{
													throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
												}
											}
										}
									}
								}
							}
							
							//过户审核更新过户时间
							if(addEvent.equals("UPDATETIMEX001"))
							{
								YwTransfer ywTransfer = new YwTransfer();
								ywTransfer.setBusiId(busiId);
								ywTransfer.setDpStatus(1);
								ywTransfer = ywTransferMapper.selectRefined(ywTransfer);
								if(null == ywTransfer)
								{
									throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"ywTransfer is null");
								}
								
								YwBusiness ywBusiness = new YwBusiness();
								ywBusiness.setId(busiId);
								ywBusiness.setPickCarTime(ywTransfer.getDateTransfer());
								ywBusiness.setTimeAuditFinish(timeAuditFinish);
								int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
								if(count < 1)
								{
									throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper update error");
								}
							}
							
							//过审的时候，需要将 dz_pick_car 中的车辆信息覆盖到 yw_business_car
							if(addEvent.equals("FKSHDZPICKCAR1207"))
							{
								//开关
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								if(switchs.equals("open"))
								{
									DzPickCar dzPickCar = new DzPickCar();
									dzPickCar.setBusiId(busiId);
									dzPickCar.setDpStatus(1);
									dzPickCar = dzPickCarMapper.selectRefined(dzPickCar);
									if(null != dzPickCar)
									{
										YwBusinessCar ywBusinessCar = new YwBusinessCar();
										ywBusinessCar.setBusiId(busiId);
										ywBusinessCar.setDpStatus(1);
										ywBusinessCar = ywBusinessCarMapper.selectRefined(ywBusinessCar);
										if(null != ywBusinessCar)
										{
											ywBusinessCar.initUpdateData(userId, loginName);
											ywBusinessCar.setCusId(dzPickCar.getCusId());
											ywBusinessCar.setCarBrand(dzPickCar.getCarBrand());
											ywBusinessCar.setCarSeries(dzPickCar.getCarSeries());
											ywBusinessCar.setNameCarBrand(dzPickCar.getNameCarBrand());
											ywBusinessCar.setCarModel(dzPickCar.getCarModel());
											ywBusinessCar.setNameCarSeries(dzPickCar.getNameCarSeries());
											ywBusinessCar.setNameCarModel(dzPickCar.getNameCarModel());
											//ywBusinessCar.setCarType();
											//ywBusinessCar.setCarPlace();
											//ywBusinessCar.setSeatNum(seatNum);
											//ywBusinessCar.setRegistrationArea();
											//ywBusinessCar.setLicencePlateType(licencePlateType);
											//ywBusinessCar.setCarOwnersName();
											ywBusinessCar.setVin(dzPickCar.getVin());
											//ywBusinessCar.setMileage();
											//ywBusinessCar.setStartYear();
											//ywBusinessCar.setStartMonth();
											//ywBusinessCar.setCarStatus();
											//ywBusinessCar.setCarPurpose(carPurpose);
											//ywBusinessCar.setEvaluateProvince(evaluateProvince);
											//ywBusinessCar.setEvaluateCity(evaluateCity);
											//ywBusinessCar.setEvaluatePrice(evaluatePrice);
											ywBusinessCar.setPrice(dzPickCar.getPrice());
											ywBusinessCar.setCategoryCar(dzPickCar.getCategoryCar());
											ywBusinessCar.setColorCar(dzPickCar.getColorCar());
											ywBusinessCar.setNumQualified(dzPickCar.getNumQualified());
											ywBusinessCar.setDisplacement(dzPickCar.getDisplacement());
											ywBusinessCar.setPower(dzPickCar.getPower());
											ywBusinessCar.setNumEngine(dzPickCar.getNumEngine());
											ywBusinessCar.setNumChassisSix(dzPickCar.getNumChassisSix());
											ywBusinessCar.setDateBill(dzPickCar.getDateBill());
											ywBusinessCar.setCompanyBill(dzPickCar.getCompanyBill());
											ywBusinessCar.setNumBill(dzPickCar.getNumBill());
											ywBusinessCar.setAreaBill(dzPickCar.getAreaBill());
											//ywBusinessCar.setIsCompleted(isCompleted);
											ywBusinessCar.setRemarks(dzPickCar.getRemarks());
											//ywBusinessCar.setStartDate(startDate);
											//ywBusinessCar.setPriceNewcar(priceNewcar);
											ywBusinessCar.setNoticeModel(dzPickCar.getNoticeModel());
											int count = ywBusinessCarMapper.updateByPrimaryKeySelective(ywBusinessCar);
											if(count < 1)
											{
												throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessCarMapper update error");
											}
										}
									}
								}
							}
							
							//过审的时候，需要将 yw_transfer中的车辆信息覆盖到 yw_business_car
							if(addEvent.equals("FKSHDZPICKCAR1207001"))
							{
								//开关
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								if(switchs.equals("open"))
								{
									YwTransfer ywTransfer = new YwTransfer();
									ywTransfer.setBusiId(busiId);
									ywTransfer.setDpStatus(1);
									ywTransfer = ywTransferMapper.selectRefined(ywTransfer);
									if(null != ywTransfer)
									{
										YwBusinessCar ywBusinessCar = new YwBusinessCar();
										ywBusinessCar.setBusiId(busiId);
										ywBusinessCar.setDpStatus(1);
										ywBusinessCar = ywBusinessCarMapper.selectRefined(ywBusinessCar);
										if(null != ywBusinessCar)
										{
											ywBusinessCar.initUpdateData(userId, loginName);
											ywBusinessCar.setCusId(ywTransfer.getCusId());
											ywBusinessCar.setCarBrand(ywTransfer.getCarBrand());
											ywBusinessCar.setCarSeries(ywTransfer.getCarSeries());
											ywBusinessCar.setNameCarBrand(ywTransfer.getNameCarBrand());
											ywBusinessCar.setCarModel(ywTransfer.getCarModel());
											ywBusinessCar.setNameCarSeries(ywTransfer.getNameCarSeries());
											ywBusinessCar.setNameCarModel(ywTransfer.getNameCarModel());
											//ywBusinessCar.setCarType();
											//ywBusinessCar.setCarPlace();
											//ywBusinessCar.setSeatNum(seatNum);
											//ywBusinessCar.setRegistrationArea();
											//ywBusinessCar.setLicencePlateType(licencePlateType);
											//ywBusinessCar.setCarOwnersName();
											ywBusinessCar.setVin(ywTransfer.getVin());
											//ywBusinessCar.setMileage();
											//ywBusinessCar.setStartYear();
											//ywBusinessCar.setStartMonth();
											//ywBusinessCar.setCarStatus();
											//ywBusinessCar.setCarPurpose(carPurpose);
											//ywBusinessCar.setEvaluateProvince(evaluateProvince);
											//ywBusinessCar.setEvaluateCity(evaluateCity);
											//ywBusinessCar.setEvaluatePrice(evaluatePrice);
											ywBusinessCar.setPrice(ywTransfer.getPrice());
											ywBusinessCar.setCategoryCar(ywTransfer.getCategoryCar());
											ywBusinessCar.setColorCar(ywTransfer.getColorCar());
											ywBusinessCar.setNumQualified(ywTransfer.getNumQualified());
											ywBusinessCar.setDisplacement(ywTransfer.getDisplacement());
											ywBusinessCar.setPower(ywTransfer.getPower());
											ywBusinessCar.setNumEngine(ywTransfer.getNumEngine());
											ywBusinessCar.setNumChassisSix(ywTransfer.getNumChassisSix());
											ywBusinessCar.setDateBill(ywTransfer.getDateBill());
											ywBusinessCar.setCompanyBill(ywTransfer.getCompanyBill());
											ywBusinessCar.setNumBill(ywTransfer.getNumBill());
											ywBusinessCar.setAreaBill(ywTransfer.getAreaBill());
											//ywBusinessCar.setIsCompleted(isCompleted);
											ywBusinessCar.setRemarks(ywTransfer.getRemarks());
											//ywBusinessCar.setStartDate(startDate);
											//ywBusinessCar.setPriceNewcar(priceNewcar);
											ywBusinessCar.setNoticeModel(ywTransfer.getNoticeModel());
											int count = ywBusinessCarMapper.updateByPrimaryKeySelective(ywBusinessCar);
											if(count < 1)
											{
												throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessCarMapper update error");
											}
										}
									}
								}
							}
							
							//风控总监审核过后  加装GPS
							if(addEvent.equals("EWSJX001"))
							{
								if(dbYwBusiness.getBusiStatus() >= 110)
								{
									YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
									ywBusinessExtras.setBusiId(busiId);
									ywBusinessExtras.setCodeExtras("AddGps");
									ywBusinessExtras.setDpStatus(1);
									ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
									
									//不为空则加装
									if(null != ywBusinessExtras)
									{
										DzGpsList dzGpsList = new DzGpsList();
										dzGpsList.initInsertData(userId, loginName);
										dzGpsList.setBusiId(busiId);
//					                    BaseCustomer baseCustomer = new BaseCustomer();
//					                    baseCustomer.setSalesmanId(dbYwBusiness.getSalesmanId());
//					                    baseCustomer.setDpStatus(1);
//					                    baseCustomer = baseCustomerMapper.selectRefined(baseCustomer);
//					                    @update 2018-02-01
					                    String customerId = dbYwBusiness.getCustomerId();
					                    BaseCustomer baseCustomer = baseCustomerMapper.selectByPrimaryKey(customerId);
					                    if(null == baseCustomer)
					                    {
					                      throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"baseCustomer is null");
					                    }
										
										dzGpsList.setCusId(baseCustomer.getId());
										dzGpsList.setLoanAmount(dbYwBusiness.getRealLoanAmount());
										dzGpsList.setChannelType(dbYwBusiness.getChannelType());
										dzGpsList.setChannelTypeName(cachedDictionaryService.getName(dbYwBusiness.getChannelType(), DataDicType.CHANNEL_TYPE));
										dzGpsList.setDealer(dbYwBusiness.getDealerId());
										DpBaseDealerInfo dBaseDealerInfo = dpBaseDealerInfoMapper.selectByPrimaryKey(dbYwBusiness.getDealerId());
										if(null == dBaseDealerInfo)
										{
											throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"dpBaseDealerInfoMapper is null");
										}
										dzGpsList.setDealerLevel(cachedDictionaryService.getName(dBaseDealerInfo.getDealerLevel(), DataDicType.DEALER_LEVEL));
										dzGpsList.setDepartmentName(dBaseDealerInfo.getDealerName());
										dzGpsList.setSalersmanName(dbYwBusiness.getSalesmanName());
										dzGpsList.setCusName(dbYwBusiness.getCustomerName());
										dzGpsList.setCusIdno(dbYwBusiness.getCustomerNo());
										dzGpsList.setBankname(cachedDictionaryService.getName(dbYwBusiness.getBankLoan(), DataDicType.LOAN_TYPE));
										if(StringUtils.isNotBlank(ywBusinessExtras.getValueExtras()))
										{
											dzGpsList.setNumGps(Integer.valueOf(ywBusinessExtras.getValueExtras()));
										}
										dzGpsList.setStatusGpsList(10);
										dzGpsList.setBankLoan(dbYwBusiness.getBankLoan());
										dzGpsList.setSalesmanCode(dbYwBusiness.getSalesmanCode());
										int count = dzGpsListMapper.insert(dzGpsList);
										if(count < 1)
										{
											throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dzGpsListMapper error");
										}
									}
									
//									#TODO 添加鑫合汇资审一审待审核记录
									
									
								}
							}
							
							//鑫合汇资审一审结果事件：往第三方信息履历写一条信息，履历描述为‘鑫合汇资审一审通过
							if(addEvent.equals("xhhzsysjg"))
							{
								//开关
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								if(switchs.equals("open"))
								{
									String busiType = "xhh";
									
									//查询第三方订单信息
									String sqlXmls = "select t.id,t.third_id from th_yw_business t where t.busi_type = '"+busiType+"' and t.busi_id = '"+busiId+"' and t.dp_status = 1 limit 1";
									Map<String, String> maps = publicDao.selectMapsSql(sqlXmls);
									if(null == maps || maps.isEmpty())
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),sqlXmls);
									}
									
									ThBusinessRecord thBusinessRecord = new ThBusinessRecord();
									thBusinessRecord.initInsertData(userId, loginName);
									thBusinessRecord.setDataId(fkAuditList.getId());
									thBusinessRecord.setBusiType(busiType);
									thBusinessRecord.setBusiId(busiId);
									thBusinessRecord.setThirdId(maps.get("third_id"));
									thBusinessRecord.setThirdModeId(ThirdModeIDType.ZSYS.getCode());
									thBusinessRecord.setThirdModeName(ThirdModeIDType.ZSYS.getValue());
									thBusinessRecord.setRecordEvent("鑫合汇资审一审通过");
									int count = thBusinessRecordMapper.insert(thBusinessRecord);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"thBusinessRecordMapper insert error");
									}
								}
							}
							
							//审核的 FinishAudit（完成风控审核）功能增加
							if(addEvent.equals("XHHSJX001"))
							{
								//开关
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								if(switchs.equals("open"))
								{
									//风控审核完成之后
									if(dbYwBusiness.getBusiStatus() >= 110)
									{
										//插入待审批列表
//										fkAuditList.initInsertData(userId, loginName);
//										fkAuditList.setModeId(ModeIDType.XHHZSYS.getCode());
//										fkAuditList.setSource(resultPName);
//										fkAuditList.setStatusList(1);
//										fkAuditList.setTimeAuditFinish(null);
//										fkAuditList.setOperatorId("");
//										fkAuditList.setOperatorName("");
//										int count = fkAuditListMapper.insert(fkAuditList);
//										if(count < 1)
//										{
//											throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper insert error");
//										}
//										
//										//修改业务信息表 第三方渠道业务状态值
//										YwBusiness ywBusiness = new YwBusiness();
//										ywBusiness.setId(busiId);
//										ywBusiness.setThirdBusiStatus(200);
//										count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
//										if(count < 1)
//										{
//											throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper update error");
//										}
//										
//										String sqlXmls = "update th_yw_business t set t.third_busi_status = '200' where t.busi_id = '"+busiId+"' and t.dp_status = 1";
//										count = publicDao.updateWhereSqlXmls(sqlXmls);
//										if(count < 1)
//										{
//											throw new BaseException(ResultFlagType.FAIL.getCode().toString(),sqlXmls);
//										}
										
//										@update2018-10-29 如果鑫合汇状态等于初审通过（150）， 往“fk_待审批列表”表插一条模块id为“M_xhhzsys”(鑫合汇资审一审)的待审批信息 
										ThYwBusiness thYwBusiness = new ThYwBusiness();
										thYwBusiness.setBusiId(busiId);
										thYwBusiness.setDpStatus(DpStatus.NORMAL.getCode());
										thYwBusiness = thYwBusinessMapper.selectRefined(thYwBusiness);
										
										//发送过鑫合汇就直接打包
										if(null != thYwBusiness)
										{
											//调用打包接口   
											ThreadFactory.THREAD_SERVICE.submit(() -> 
													{
												    	//张老师的
										            	String fileName = qiniuFileService.xxhDataZip(busiId);
										            	logger.debug(fileName);
										            	logger.error(fileName);
														if(StringUtils.isBlank(fileName))
														{
															logger.error("{fileName  is null xxhDataZip is error}....{zhangzj}");
														}
												   });
										}
									}
								}
							}
							
							//财务审核一通过调整
							if(addEvent.equals("CWSHYX001"))
							{
								if(null != fengKongShenHeV001ZiDongExe)
								{
									YwBusiness ywBusiness = new YwBusiness();
									ywBusiness.setId(busiId);
									ywBusiness.setBusiType(fengKongShenHeV001ZiDongExe.getBusiType());
									ywBusiness.setDpStatus(1);
									int count = ywBusinessMapper.updateByPrimaryKeySelective(ywBusiness);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"ywBusinessMapper update error");
									}
									
									//如果选择了鑫合汇，调用鑫合汇网商终审申请模块
									if(fengKongShenHeV001ZiDongExe.getBusiType().equals("xhh"))
									{
										ThreadFactory.THREAD_SERVICE.submit(
											new Thread(){
											    public void run(){
											 
									            	try 
									            	{
									            		String sqlXmls = "INSERT INTO `sys_log4j` VALUES ('"+UUIDFactory.getUUID()+"', '财务一审发送鑫合汇', '"+busiId+"', '', '', '"+DateUtil.dateTo14String(new Date())+"','','',0)";
												    	WhereSqlExt whereSqlExt = new WhereSqlExt();
										            	whereSqlExt.setWhereSql(sqlXmls);
										            	publicDao.insertWhereSql(whereSqlExt);
													} 
									            	catch (Exception e) 
									            	{
														
									            		logger.error(e.getMessage());
													}
									            	
									            	//调用熊    调用鑫合汇网商终审申请模块
													boolean b = thYwBusinessRequestService.saveSubmitXinHeHuiAudit(busiId, currentUser.getId(),currentUser.getName());
													if(!b)
													{
														logger.error("{thYwBusinessRequestService.saveSubmitXinHeHuiAudit(busiId, currentUser)} error ,xiaoxiong is error");
														//throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"发生未知异常，请联系碟普科技客服，电话：0571-87097208");
													}
											   }
										});
									}
								}
							}
							
							//退押金续保审核通过时，增加额外事件：如果该客户有逾期记录（dh_逾期客户表有相应数据），则增加一条 ModeID为退押金催收审核（M_tyjcssh ）的待审核数据，否则将退押金状态更改为 50（待退款）；
							if(addEvent.equals("M_TYJXBSH_125"))
							{
								String sqlXmls = "select count(t.id) count from dh_overduelist t where t.busi_id = '"+busiId+"' and t.dp_status = 1";
								int count = publicDao.countSqlXmls(sqlXmls);
								if(count > 0)
								{
									FkAuditList auditList = new FkAuditList();
									auditList.setModeId(ModeIDType.TYJXBSHH.getCode());
									auditList.setBusiId(busiId);
									auditList.setDpStatus(1);
									auditList = fkAuditListMapper.selectRefined(auditList);
									if(null != auditList)
									{
										fkAuditList.initInsertData(userId, loginName);
										fkAuditList.setModeId(ModeIDType.TYJCSHSHH.getCode());
										fkAuditList.setSource(resultPName);
										fkAuditList.setStatusList(1);
										fkAuditList.setTimeAuditFinish(null);
										fkAuditList.setOperatorId("");
										fkAuditList.setOperatorName("");
										count = fkAuditListMapper.insert(fkAuditList);
										if(count < 1)
										{
											throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper insert error");
										}
									}
								}
								
								if(count < 1)
								{
									DhDepositMoney dhDepositMoney = new DhDepositMoney();
									dhDepositMoney.setBusiId(busiId);
									dhDepositMoney.setDpStatus(1);
									dhDepositMoney = dhDepositMoneyMapper.selectRefined(dhDepositMoney);
									if(null == dhDepositMoney)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dhDepositMoneyMapper dhDepositMoney is null");
									}
									
									dhDepositMoney.setStatusRefundDeposit(50);
									count = dhDepositMoneyMapper.updateByPrimaryKeySelective(dhDepositMoney);
									if(count < 1)
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"dhDepositMoneyMapper updateByPrimaryKeySelective error");
									}
								}
							}
//							@update2018-02-09
							//添加鑫合汇资审一审记录
							if(addEvent.equals("AddXhhFkAuditList"))
							{
								//开关
								String switchs = objectAdditionalEvent.get("switch").getAsString();
								if(switchs.equals("open"))
								{
									//风控审核完成之后
									if(dbYwBusiness.getBusiStatus() >= BusiStatus.SHEN_PI_WAN_CHENG.getCode())
									{
//										@update2018-02-09 如果鑫合汇状态等于初审通过（150）， 往“fk_待审批列表”表插一条模块id为“M_xhhzsys”(鑫合汇资审一审)的待审批信息 
										ThYwBusiness thYwBusiness = new ThYwBusiness();
										thYwBusiness.setBusiId(busiId);
										thYwBusiness.setDpStatus(DpStatus.NORMAL.getCode());
										thYwBusiness = thYwBusinessMapper.selectRefined(thYwBusiness);
  										if(null != thYwBusiness && ThirdBusiStatus.CHU_SHEN_TONG_GUO.getCode().equals(thYwBusiness.getThirdBusiStatus())) 
										{
  											dbYwBusiness.setThirdBusiStatus(ThirdBusiStatus.XHH_ZI_SHEN_YI_SHEN_ZHONG.getCode());
  											thYwBusiness.setThirdBusiStatus(ThirdBusiStatus.XHH_ZI_SHEN_YI_SHEN_ZHONG.getCode());
  											ywBusinessMapper.updateByPrimaryKeySelective(dbYwBusiness);
  											thYwBusinessMapper.updateByPrimaryKeySelective(thYwBusiness);
											fkAuditList.initInsertData(userId, loginName);
											fkAuditList.setModeId(ModeIDType.XHHZSYS.getCode());
											fkAuditList.setSource(resultPName);
											fkAuditList.setStatusList(1);
											fkAuditList.setTimeAuditFinish(null);
											fkAuditList.setOperatorId("");
											fkAuditList.setOperatorName("");
											int count = fkAuditListMapper.insert(fkAuditList);
											if(count < 1)
											{
												throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
											}
										}
									}
								}
							}
							
							
							//欠资料通过
							if(passEvent.equals("lesspass"))
							{
								//资料补齐审核插入事件
								if(addEvent.equals("insertZlbqsh"))
								{
									//判断是否为资料补齐审核
									if(dbYwBusiness.getLessInformationStatus() == 10)
									{
										FkAuditList auditList = new FkAuditList();
										auditList.setModeId(ModeIDType.ZLBQSH.getCode());
										auditList.setBusiId(busiId);
										auditList.setStatusList(1);
										auditList.setDpStatus(1);
										auditList = fkAuditListMapper.selectRefined(auditList);
										if(null == auditList || ("").equals(auditList))
										{
											//插入风控经理审核数据
											fkAuditList.initInsertData(userId, loginName);
											fkAuditList.setModeId(ModeIDType.ZLBQSH.getCode());
											fkAuditList.setSource(resultPName);
											fkAuditList.setStatusList(1);
											fkAuditList.setTimeAuditFinish(null);
											fkAuditList.setOperatorId("");
											fkAuditList.setOperatorName("");
											int count = fkAuditListMapper.insert(fkAuditList);
											if(count < 1)
											{
												throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper error");
											}
										}
									}
								}
							}
						}
					}
				}
				break;
			}
		}
		//没有找到可执行的节点
		if(!modeIdBoolean)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"没有找到可执行的节点，请配置");
		}
	}
	
	//自动审核
	private void diepuZdshListDiepu(AbstractSysUser currentUser,FkAuditList fkAuditList, OtherAuditInfo otherAuditInfo,String passEvent,String serverRealPath,String zdshName,FengKongShenHeV001ZiDongExe fengKongShenHeV001ZiDongExe)throws Exception
	{
		JsonParser parse =new JsonParser();  
		JsonObject json = (JsonObject) parse.parse(new FileReader(serverRealPath)); 
		JsonArray  array = json.get("result").getAsJsonArray();
		if(null == array || 0 == array.size())
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"读取审核配置文件为空");
		}
		
		//模块编号
		String modeId = fkAuditList.getModeId();
		String busiId = fkAuditList.getBusiId();
		
		boolean modeIdBoolean = false;
		
		for(int i=0;i<array.size();i++)
		{
			JsonObject object = array.get(i).getAsJsonObject();
			//模块编号
			String resultModeId = object.get("modeId").getAsString();
			
			if(modeId.equals(resultModeId))
			{
				modeIdBoolean = true;
				
				//自动审核名称
				String resultSwitch =  object.get("switch").getAsString();
				if(resultSwitch.equals("open"))
				{
					JsonArray  arrayZdshList = object.get("zdshList").getAsJsonArray();
					if(null != arrayZdshList && arrayZdshList.size() > 0)
					{
						for(int y=0;y<arrayZdshList.size();y++)
						{
							JsonObject objectZdshList = arrayZdshList.get(y).getAsJsonObject();
							String eventPass = objectZdshList.get("eventPass").getAsString();
							
							//第一种审核
							if(eventPass.equals("ZDSH001"))
							{
								String autoAudit = objectZdshList.get("autoAudit").getAsString();
								double confMoney = 0;
								if(autoAudit.equals("AutoAudit_Recheck"))
								{
									String sqlXmls = "select t.id,t.value_param from base_sys_params t where t.code_param = 'AutoAudit_Recheck' limit 1";
									Map<String, String> maps = publicDao.selectMapsSql(sqlXmls);
									if(null != maps && StringUtils.isNotBlank(maps.get("value_param"))) 
									{
										confMoney = Double.parseDouble(maps.get("value_param"));
									}
									
									if(null == fkAuditList.getLoanAmount() || ("").equals(fkAuditList.getLoanAmount()))
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditList.getLoanAmount() is null");
									}
									
									//审批金额
									double loan_amount = fkAuditList.getLoanAmount();
									if(loan_amount <= confMoney)
									{
										eventPass(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,zdshName,fengKongShenHeV001ZiDongExe);
										break;
									}
								}
								else if(autoAudit.equals("AutoAudit_Supervisor_Info"))
								{
									String sqlXmls = "select t.id,t.value_param from base_sys_params t where t.code_param = 'AutoAudit_Supervisor_Info' limit 1";
									Map<String, String> maps = publicDao.selectMapsSql(sqlXmls);
									if(null != maps && StringUtils.isNotBlank(maps.get("value_param"))) 
									{
										confMoney = Double.parseDouble(maps.get("value_param"));
									}
									
									if(null == fkAuditList.getLoanAmount() || ("").equals(fkAuditList.getLoanAmount()))
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditList.getLoanAmount() is null");
									}
									
									//审批金额
									double loan_amount = fkAuditList.getLoanAmount();
									if(loan_amount <= confMoney)
									{
										eventPass(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,zdshName,fengKongShenHeV001ZiDongExe);
										break;
									}
								}
								else if(autoAudit.equals("AutoAudit_PhoneOne"))
								{
									String sqlXmls = "select t.id,t.value_param from base_sys_params t where t.code_param = 'AutoAudit_PhoneOne' limit 1";
									Map<String, String> maps = publicDao.selectMapsSql(sqlXmls);
									if(null != maps && StringUtils.isNotBlank(maps.get("value_param"))) 
									{
										confMoney = Double.parseDouble(maps.get("value_param"));
									}
									
									if(null == fkAuditList.getLoanAmount() || ("").equals(fkAuditList.getLoanAmount()))
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditList.getLoanAmount() is null");
									}
									
									//审批金额
									double loan_amount = fkAuditList.getLoanAmount();
									if(loan_amount <= confMoney)
									{
										eventPass(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,zdshName,fengKongShenHeV001ZiDongExe);
										break;
									}
								}
								else if(autoAudit.equals("AutoAudit_Director"))
								{
									String sqlXmls = "select t.id,t.value_param from base_sys_params t where t.code_param = 'AutoAudit_Director' limit 1";
									Map<String, String> maps = publicDao.selectMapsSql(sqlXmls);
									if(null != maps && StringUtils.isNotBlank(maps.get("value_param"))) 
									{
										confMoney = Double.parseDouble(maps.get("value_param"));
									}
									
									if(null == fkAuditList.getLoanAmount() || ("").equals(fkAuditList.getLoanAmount()))
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditList.getLoanAmount() is null");
									}
									
									//审批金额
									double loan_amount = fkAuditList.getLoanAmount();
									if(loan_amount <= confMoney)
									{
										eventPass(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,zdshName,fengKongShenHeV001ZiDongExe);
										break;
									}
								}
								else if(autoAudit.equals("AutoAudit_Supervisor_Phone"))
								{
									String sqlXmls = "select t.id,t.value_param from base_sys_params t where t.code_param = 'AutoAudit_Supervisor_Phone' limit 1";
									Map<String, String> maps = publicDao.selectMapsSql(sqlXmls);
									if(null != maps && StringUtils.isNotBlank(maps.get("value_param"))) 
									{
										confMoney = Double.parseDouble(maps.get("value_param"));
									}
									
									if(null == fkAuditList.getLoanAmount() || ("").equals(fkAuditList.getLoanAmount()))
									{
										throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditList.getLoanAmount() is null");
									}
									
									//审批金额
									double loan_amount = fkAuditList.getLoanAmount();
									if(loan_amount <= confMoney)
									{
										eventPass(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,zdshName,fengKongShenHeV001ZiDongExe);
										break;
									}
								}
							}
							//第二种审核
							else if(eventPass.equals("ZDSH002"))
							{
								String green = objectZdshList.get("green").getAsString();
								if(green.equals("yes"))
								{
									if(fkAuditList.getChannelType().equals("50"))
									{
										eventPass(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,zdshName,fengKongShenHeV001ZiDongExe);
										break;
									}
								}
							}
							//第三种审核
							else if(eventPass.equals("ZDSH003"))
							{
								String green = objectZdshList.get("IsPhoneAudit").getAsString();
								if(green.equals("yes"))
								{
									YwBusinessExtras ywBusinessExtras = new YwBusinessExtras();
									ywBusinessExtras.setBusiId(busiId);
									ywBusinessExtras.setCodeExtras("IsPhoneAudit");
									ywBusinessExtras.setDpStatus(1);
									ywBusinessExtras = ywBusinessExtrasMapper.selectRefined(ywBusinessExtras);
									if(null != ywBusinessExtras)
									{
										if(ywBusinessExtras.getValueExtras().equals("0"))
										{
											eventPass(currentUser,fkAuditList,otherAuditInfo,passEvent,serverRealPath,zdshName,fengKongShenHeV001ZiDongExe);
											break;
										}
									}
								}
							}
						}
					}
					break;
				}
				break;
			}
		}
		//没有找到可执行的节点
		if(!modeIdBoolean)
		{
			throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"没有找到可执行的节点，请配置");
		}
	}

	/*  
	*  @author  zhangpp
	*  <p>Title:  diepuZiDongShenWaiBu</p>  
	*  <p>Description:  </p>  
	*  @param currentUser
	*  @param fkAuditList
	*  @param otherAuditInfo
	*  @param serverRealPath
	*  @param zdshName
	*  @throws Exception  
	*  @see com.zjdiepu.www.ibiz.zpp.FengKongShenHeService#diepuZiDongShenWaiBu(com.zjdiepu.www.base.core.AbstractSysUser, com.zjdiepu.www.model.fk.dto.FkAuditList, com.zjdiepu.www.model.other.dto.OtherAuditInfo, java.lang.String, java.lang.String)  
	*  @version  V1.0
	*/
	@Override
	public void diepuZiDongShenWaiBu(AbstractSysUser currentUser,String[] modeId,String busiId,String serverRealPath) throws Exception 
	{
		
		if(null == currentUser)
		{
			throw new BaseException(ResultFlagType.LOGIN_TIMEOUT.getCode().toString(),ResultFlagType.LOGIN_TIMEOUT.getValue());
		}
		if(StringUtils.isBlank(serverRealPath))
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"必须参数不能为空  serverRealPath");
		}
		
		if(null == modeId || modeId.length < 1)
		{
			throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"必须参数不能为空  modeId[]");
		}
		
		for(int i=0;i<modeId.length;i++)
		{
			FkAuditList auditList = new FkAuditList();
			auditList.setModeId(modeId[i]);
			auditList.setBusiId(busiId);
			auditList.setDpStatus(1);
			auditList = fkAuditListMapper.selectRefined(auditList);
			if(null == auditList)
			{
				throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"必须参数不能为空  auditList");
			}
			diepuZdshListDiepu(currentUser,auditList,null,"pass",serverRealPath,null,null);
			diepuCheckModeIdBusiId(modeId[i],busiId);
		}
	}
	
	
	//检查提交终身造成的重复数据
	private void diepuCheckModeIdBusiId(String modeId,String busiId)
	{
		String sqlXmls = "select count(t.id) count from fk_audit_list t where t.mode_id = '"+modeId+"' and t.busi_id = '"+busiId+"' and t.dp_status = 1 and t.status_list = 1";
		int count = publicDao.countSqlXmls(sqlXmls);
		if(count > 1)
		{
			int sum = count - 1;
			for(int i=0;i<sum;i++)
			{
				FkAuditList fkAuditList = new FkAuditList();
				fkAuditList.setBusiId(busiId);
				fkAuditList.setModeId(modeId);
				fkAuditList.setStatusList(1);
				fkAuditList.setDpStatus(1);
				fkAuditList = fkAuditListMapper.selectRefined(fkAuditList);
				if(null == fkAuditList)
				{
					throw new BaseException(ResultFlagType.MISSING.getCode().toString(),"fkAuditListMapper selectRefined is null");
				}
				int index = fkAuditListMapper.deleteByPrimaryKey(fkAuditList.getId());
				if(index < 1)
				{
					throw new BaseException(ResultFlagType.FAIL.getCode().toString(),"fkAuditListMapper deleteByPrimaryKey error");
				}
			}
		}
	}
}
